<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:replace="_header_include::frag(~{::title},~{::style},~{})">
    <title>我的客户</title>
    <style>
        /*页面不可复制*/
        html,body{
            -moz-user-select:none; /* Firefox私有属性 */
            -webkit-user-select:none; /* WebKit内核私有属性 */
            -ms-user-select:none; /* IE私有属性(IE10及以后) */
            -khtml-user-select:none; /* KHTML内核私有属性 */
            -o-user-select:none; /* Opera私有属性 */
            user-select:none; /* CSS3属性 */
        }
        button a {
            color: #fff !important;
        }

        /*.formItem,.formItem .el-form-item__content{width:100%}*/
        .paddB20 {
            padding: 0 0 20px 20px;
            font-size: 16px;
        }
        .notVisitReasonFs14 .el-form-item__label{font-size: 14px;}

    </style>
</head>
<body>

<div id="mainDiv" class="mainPadding" style="display: none;">    
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20" v-if="isElBreadcrumb">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>商务管理</el-breadcrumb-item>
        <el-breadcrumb-item>我的客户（商务）</el-breadcrumb-item>
    </el-breadcrumb>
    <table-uniontabtemplate :param="dataUrlParam" v-else></table-uniontabtemplate>
    <el-row class="marginB20">
        <el-button type="primary" @click="notVisit">标记未到访</el-button>
        <shiro:hasPermission name="businessMyCustomer:add">
            <el-button type="warning" @click="createClueData">新建客户资源</el-button>
        </shiro:hasPermission>
    </el-row>
    <div class="mainSearchBg">
        <div class="mainSearchFormBox">
            <el-form :inline="true" :model="queryForm" class="demo-form-inline mainSearchForm" ref="queryForm">
                <el-form-item label="邀约来访时间:">
                    <el-date-picker v-model="queryForm.reserveTime1" type="datetime"
                                    placeholder="选择日期时间"></el-date-picker>
                </el-form-item>
                <el-form-item label="—" class="widthauto">
                    <el-date-picker v-model="queryForm.reserveTime2" type="datetime"
                                    placeholder="选择日期时间"></el-date-picker>
                </el-form-item>
                <el-form-item label="到访状态:">
                    <el-select v-model="queryForm.visitStatus" clearable placeholder="到访状态">
                        <el-option v-for="item in visitArr" :key="item.value" :label="item.name"
                                   :value="item.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="签约状态:">
                    <el-select v-model="queryForm.isSign" clearable placeholder="签约状态" :disabled="disabledIsSign">
                        <el-option v-for="item in signArr" :key="item.value" :label="item.name" :value="item.value"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="电销组:">
                    <el-select v-model="queryForm.teleGroupId" clearable placeholder="电销组" filterable>
                        <el-option v-for="item in teleketGroupArr" :key="item.id" :label="item.name"
                                   :value="item.id"></el-option>
                    </el-select>
                </el-form-item>
                <el-row v-show="isShow">
                    <el-form-item label="提交邀约时间:">
                        <el-date-picker v-model="queryForm.appiontmentCreateTime1" type="datetime"
                                        placeholder="选择日期时间"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="—" class="widthauto">
                        <el-date-picker v-model="queryForm.appiontmentCreateTime2" type="datetime"
                                        placeholder="选择日期时间"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="电销顾问:">
                        <el-select v-model="queryForm.teleSaleId" clearable  placeholder="电销顾问" filterable>
                            <el-option v-for="item in teleketSaleArr" :key="item.id" :label="item.name" :value="item.id"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="考察项目:">
                        <el-select v-model="queryForm.tasteProjectId" placeholder="考察项目" clearable filterable @change="getShopType">
                            <el-option v-for="item in projectArr" :key="item.id" :label="item.projectName"
                                       :value="item.id"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="客户姓名:">
                        <el-input v-model="queryForm.cusName" placeholder="请输入客户姓名"></el-input>
                    </el-form-item>
                    <el-form-item label="接收邀约时间:">
                        <el-date-picker v-model="queryForm.allocateTime1" type="datetime"
                                        placeholder="选择日期时间"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="—" class="widthauto">
                        <el-date-picker v-model="queryForm.allocateTime2" type="datetime"
                                        placeholder="选择日期时间"></el-date-picker>
                    </el-form-item>
                    <el-form-item label="是否补齐尾款:">
                        <el-select v-model="queryForm.isTailMoney" placeholder="是否补齐尾款" clearable :disabled="disabledIsTailMoney">
                            <el-option v-for="item in isTailMoneyArr" :key="item.value" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="资源Id:">
                        <el-input v-model="queryForm.clueId" placeholder="请输入资源Id"></el-input>
                    </el-form-item>
                    <el-form-item label="联系方式:">
                        <el-input v-model="queryForm.linkPhone" placeholder="请输入联系方式"></el-input>
                    </el-form-item>
                    <el-form-item label="签约单编号:">
                        <el-input v-model="queryForm.signNo" placeholder="签约单编号"></el-input>
                    </el-form-item>
                </el-row>
                <div class="mainSearchBtnBox">
                    <el-button icon="el-icon-search" type="primary" @click="initList" class="searchBtn">搜索</el-button>
                    <!-- <el-button type="info" class="searchBtn">取消</el-button> -->
                    <span style="color: #5c6be8;cursor: pointer;margin:0 10px;" @click="toogleClick"><span
                            v-if="isShow">收起</span><span v-else>展开更多</span><i
                            :class="{'greycolor paddingL6 el-icon-arrow-up':isShow,'greycolor paddingL6 el-icon-arrow-down':!isShow}"></i></span>
                </div>
            </el-form>
        </div>
        <el-table :data="tableData" border tooltip-effect="dark" style="width:100%" ref="multipleTable" @row-click="clickRow"
                  @row-dblclick="showCustomerDetail" @selection-change="handleSelectionChange">
            <el-table-column type="selection" width="55" prop="clueId" align="center"></el-table-column>
            <el-table-column prop="xh" label="序号" width="60" type="index" align="center"></el-table-column>
            <el-table-column prop="reserveTime" label="邀约来访时间" sortable align="center" width="130px"></el-table-column>
            <el-table-column prop="cusName" label="客户姓名" align="center" width="120">
                <template slot-scope="scope">
                    <div class="bluecolor cursorP" @click="editCustomerDetail(scope.row)">{{scope.row.cusName}}</div>
                </template>
            </el-table-column>
            <el-table-column prop="linkPhone" label="联系方式" align="center" width="100"></el-table-column>
            <el-table-column prop="tasteProjectName" label="考察项目" align="center" width="130"></el-table-column>
            <el-table-column prop="province" label="开店省份" align="center" width="80"></el-table-column>
            <el-table-column prop="city" label="开店城市" align="center" width="80"></el-table-column>
            <el-table-column prop="district" label="开店区/县" align="center" width="85"></el-table-column>
            <el-table-column prop="purTypeName" label="意向品类" align="center" width="100"></el-table-column>
            <el-table-column prop="visitStatus" label="到访状态" :formatter="formatVisitStatus" align="center" width="80"></el-table-column>
            <el-table-column prop="" label="到访情况" :formatter="formatVisit" align="center" width="130">
                <template slot-scope="scope">
                    <!--<el-button size="mini"  v-if="(scope.row.visitStatus == -1||scope.row.visitStatus == null)&&scope.row.visitAuditStatus==null" type="text" @click="openEditVisitRecord(scope.row)">添加到访记录</el-button>-->
                    <el-button size="mini" v-if="scope.row.visitList.length==0" type="text"
                               @click.stop="openEditVisitRecord(scope.row)">添加到访记录
                    </el-button>
                    <div v-else-if="scope.row.visitList.length==1" v-for="item in scope.row.visitList ">
                        <!--<el-button size="mini"  v-if="scope.row.visitStatus==0" type="text" @click="showNotVisitReason(scope.row)">未到访(原因)</el-button>-->
                        <el-button size="mini" v-if="item.isVisit==0&&item.status==1" type="text"
                                   @click="showNotVisitReason1(item)">未到访(审核中)
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==0&&item.status==2" type="text"
                                   style="color: red" @click="showNotVisitReason(item)">未到访（原因）
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==0&&item.status==0" type="text"
                                   @click="openEditVisitRecord(item)">添加到访记录
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==1&&item.status==1" type="text"
                                   @click="showVisitRecord(item)" style="color: green">审核中
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==1&&item.status==0" type="text"
                                   style="color: red" @click="editRebutVisitRecord(item)">到访被驳回
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==1&&item.status==2" type="text"
                                   @click="toVisitRecordPage(item )">查看到访记录
                        </el-button>
                    </div>
                    <div v-else-if="scope.row.visitList.length>1" v-for="item in scope.row.visitList ">
                        <el-button size="mini" v-if="item.isVisit==0&&item.status==1" type="text"
                                   @click.stop="showNotVisitReason(item)">未到访(审核中)
                        </el-button>
                        <!--<el-button size="mini"  v-else-if="item.isVisit==0&&item.status==0" type="text" @click="openEditVisitRecord(item)">添加到访记录</el-button>-->
                        <el-button size="mini" v-else-if="item.isVisit==0&&item.status==2" type="text"
                                   style="color: red" @click.stop="showNotVisitReason(item)">未到访（原因）
                        </el-button>
                        <el-button size="mini" v-else-if="item.isVisit==1&&item.status==0" type="text"
                                   style="color: red" @click.stop="editRebutVisitRecord(item)">到访被驳回
                        </el-button>
                    </div>
                    <div v-if="scope.row.rejectVisitList.length>0" v-for="item in scope.row.rejectVisitList ">
                        <el-button size="mini" type="text" @click.stop="rejectNotVisit(item)" style="color: green">
                            <span style="color: red">未到访(被驳回)</span>
                        </el-button>
                    </div>
                    <div v-if="scope.row.visitList.length>1 && scope.row.isVisitAuditStatusOne==1">
                        <el-button size="mini" type="text" @click.stop="showVisitRecord(scope.row)" style="color: green">
                            审核中
                        </el-button>
                    </div>
                    <div v-if="scope.row.visitList.length>1 && scope.row.isVisitAuditStatus==1">
                        <el-button size="mini" type="text" @click="toVisitRecordPage(scope.row)">
                            查看到访记录
                        </el-button>
                    </div>
                    <div v-if="scope.row.visitHisList.length>0">
                        <el-button size="mini" type="text" @click.stop="showHistory(scope.row)">历史到访记录</el-button>
                    </div>
                </template>
            </el-table-column>            
            <el-table-column prop="isSign" label="签约状态" :formatter="formatSignStatus" align="center" width="88"></el-table-column>
            <el-table-column prop="status" label="签约单" align="center" width="250">
                <template slot-scope="scope">
                    <el-button size="mini" v-if="scope.row.signAuditStatus==null" type="text"
                               @click.stop="editSign(scope.row)">添加签约单
                    </el-button>
                    <div v-if="scope.row.signList.length>=1" v-for="item in scope.row.signList">
                        <el-button size="mini" v-if="item.signStatus==0" type="text" style="color: red"
                                   @click.stop="editRebutSign(item)">
                            <span style="color: blue">{{item.signNo}}</span><span style="color: red">（被驳回）</span>
                        </el-button>
                        <el-button size="mini" v-else-if="item.signStatus==1" type="text" style="color:#4ab65c"
                                   @click="toReadOnlySignPage(item)">
                            <span style="color: blue">{{item.signNo}}</span><span style="color: green">（审核中）</span>
                        </el-button>
                        <el-button size="mini"
                                   v-else-if="item.signStatus==2 && (item.refundStatus==4 || item.refundStatus==6)"
                                   type="text"
                                   style="color:red" @click="toSignPage(item)">
                            <span style="color: blue">{{item.signNo}}</span><span style="color: red">（已退款）</span>
                        </el-button>
                        <el-button size="mini"
                                   v-else-if="item.signStatus==2 && item.refundStatus != 4 && item.refundStatus != 6"
                                   type="text"
                                   @click="toSignPage(item)">{{item.signNo}}
                        </el-button>
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="signShopTypeName" label="签约店型" align="center" width="80"></el-table-column>
            <el-table-column prop="advanceAmount" label="投资金额" align="center" width="80"></el-table-column>
            <el-table-column prop="anotherBusSale" label="辅助商务经理" align="center" width="100px"></el-table-column>
            <el-table-column  prop="teleSaleName" label="电销顾问" align="center" width="100"></el-table-column>
            <el-table-column align="center" prop="accountPhone" label="电销顾问电话" width="110"></el-table-column>
            <el-table-column prop="teleGorupName" label="电销组" align="center" width="100"></el-table-column>
            <el-table-column prop="teleDirectorName" label="电销总监" align="center" width="100"></el-table-column>
            <el-table-column prop="teleProjectName" label="电销组项目" align="center" width="120px"></el-table-column>
            <el-table-column prop="appiontmentCreateTime" label="提交邀约来访时间" sortable align="center" width="145px"></el-table-column>            
            <el-table-column prop="allocateTime" label="接收邀约时间" sortable align="center" width="130px"></el-table-column>
            <el-table-column prop="delFalg" label="邀约来访状态" align="center" width="100px">
                <template slot-scope="scope">
                    <div v-if="scope.row.delFalg == 0">
                        正常
                    </div>
                    <div v-else-if="scope.row.delFalg ==1">
                        已删除
                    </div>
                    <div v-else-if="scope.row.delFalg ==2">
                        取消
                    </div>
                </template>
            </el-table-column>

            <!-- <el-table-column prop="isInviteLetter" label="是否有邀请函" align="center" width="100px" :formatter="transformLetter" ></el-table-column>            
            <el-table-column prop="sex" label="客户性别" align="center" width="70px">
                <template slot-scope="scope">
                    <div v-if="scope.row.sex === 1">
                        男
                    </div>
                    <div v-else-if="scope.row.sex ===2">
                        女
                    </div>
                </template>
            </el-table-column>
            <el-table-column prop="age" label="客户年龄" align="center" width="70"></el-table-column>            
            <el-table-column prop="partnerTypeName" label="合伙人" width="65px" align="center"></el-table-column>
            <el-table-column prop="hasExperience" label="餐饮经验" align="center" width="80"></el-table-column>            
            <el-table-column prop="hasAddress" label="选址情况" align="center" width="85"></el-table-column>
            <el-table-column prop="area" label="店铺面积" align="center" width="85"></el-table-column> -->
            
        </el-table>
        <table-pagination v-if="paginationShow" :pager="pager" @change="initList"></table-pagination>
    </div>
    <!--添加到访记录-->
    <el-dialog title="未到访原因" :visible.sync="notVisitdDialogVisible" width="70%">
        <template>
            <el-form :model="notVisitFlag" ref="notVisitFlag">
                <el-form-item label="" :label-width="formLabelWidth" :required="true">
                    <!--<el-button type="text" disabled style="color: #1e2746">{{notVisitFlag.str}}</el-button>-->
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">标记未到访人员：{{notVisitFlag.createUserName}}</span>
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">标记未到访时间：{{notVisitFlag.notVisitTime}}</span>
                    <br>
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">未到访原因：<br>{{notVisitFlag.str}}</span>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer" style="text-align: center">
                <el-button type="primary" @click="openEditVisitRecord">添加到访记录</el-button>
            </div>
        </template>
    </el-dialog>
    <!--添加到访记录-->
    <el-dialog title="未到访原因" :visible.sync="notVisitdDialogVisible1" width="540px">
        <template>
            <el-form :model="notVisitFlag" ref="notVisitFlag">
                <el-form-item label="" :label-width="formLabelWidth" :required="true">
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">标记未到访人员：{{notVisitFlag.createUserName}}</span>
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">标记未到访时间：{{notVisitFlag.notVisitTime}}</span>
                    <br>
                    <span style="display:block;color: #1e2746; width:90%; word-wrap:break-word; word-break:normal;">未到访原因：<br>{{notVisitFlag.str}}</span>
                </el-form-item>
            </el-form>
        </template>
    </el-dialog>
    <!--标记未到访-->
    <el-dialog title="提示" :visible.sync="notVisitFlagDialogVisible" width="540px">
        <template>
            <el-form :model="notVisitFlag" ref="notVisitFlag" :rules="notVisitFlagRules">
                <el-form-item>
                    <!--<el-button type="text" disabled style="color: #1e2746; width:100px; word-wrap:break-word; word-break:normal;">{{notVisitFlag.str}}</el-button>-->
                    <span style="display:block;color: #1e2746; width:100%; word-wrap:break-word; word-break:normal;"><span style="color:red;">* </span>{{notVisitFlag.str}}</span>
                </el-form-item>
                <el-form-item label=""  prop="notVisitReason">
                    <el-input type="textarea" v-model="notVisitFlag.notVisitReason" maxlength="100" :rows="3"
                              placeholder="请输入内容(限制100字)"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="saveNotVisit" :disabled="notVisitButtonAble">确定</el-button>
                <el-button @click="notVisitFlagDialogVisible = false">取消</el-button>
            </div>
        </template>
    </el-dialog>

    <!--添加到访记录-->
    <el-dialog title="添加到访记录" :visible.sync="addVisitRecordDialogVisible" width="70%">
        <template>
            <el-form :model="addVisitRecord" ref="addVisitRecord" :rules="rulesVisit">
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="考察公司" :label-width="formLabelWidth" prop="companyid">
                            <el-select v-model="addVisitRecord.companyid" placeholder="考察公司" clearable filterable
                                       style="width:100%">
                                <el-option v-for="item in companyArr" :key="item.id" :label="item.companyName"
                                           :value="item.id"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>

                    <el-col :span="10">
                        <el-form-item label="到访时间" :label-width="formLabelWidth" prop="vistitTime">
                            <el-date-picker v-model="addVisitRecord.vistitTime" format="yyyy-MM-dd HH:mm"
                                            type="datetime" placeholder="选择日期时间" style="width:90%"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="客户姓名" :label-width="formLabelWidth" prop="customerName">
                            <el-input v-model="addVisitRecord.customerName" autocomplete="off"
                                      maxlength="10"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="考察项目" :label-width="formLabelWidth" prop="projectId">
                            <el-select v-model="addVisitRecord.projectId" placeholder="请选择" clearable filterable
                                       style="width:100%" @change="getShopType">
                                <el-option
                                        v-for="item in signProjectList"
                                        :key="item.id"
                                        :label="item.projectName"
                                        :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="到访类型" :label-width="formLabelWidth" prop="visitType">
                            <el-select v-model="addVisitRecord.visitType" clearable style="width:100%">
                                <el-option v-for="item in visitTypeArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="到访店铺类型" :label-width="formLabelWidth" prop="vistitStoreType">
                            <el-select v-model="addVisitRecord.vistitStoreType" placeholder="请选择"
                                       style="width:100%" clearable filterable>
                                <el-option v-for="item in vistitStoreTypeArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="签约省份" :label-width="formLabelWidth" prop="signProvince">
                            <el-select v-model="addVisitRecord.signProvince" placeholder="请选择"
                                       @change="changeVisitProvince" clearable filterable style="width:100%">
                                <el-option v-for="item in provinceArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="签约城市" :label-width="formLabelWidth" prop="signCity" clearable
                                      style="width:100%">
                            <el-select v-model="addVisitRecord.signCity" placeholder="请选择" @change="changeVisitCity"
                                       style="width:100%" clearable filterable>
                                <el-option v-for="item in cityArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="签约区/县" :label-width="formLabelWidth" prop="signDistrict">
                            <el-select v-model="addVisitRecord.signDistrict" placeholder="请选择" clearable filterable
                                       style="width:100%">
                                <el-option v-for="item in districtArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                    <!--    <el-form-item label="到访城市" :label-width="formLabelWidth" prop="arrVisitCity">
                            <el-input v-model="addVisitRecord.arrVisitCity" autocomplete="off" maxlength="50"></el-input>
                        </el-form-item>-->
                        <el-form-item label="到访城市" :label-width="formLabelWidth" prop="arrVisitCity">
                        <el-select v-model="addVisitRecord.arrVisitCity" placeholder="请选择" clearable filterable
                                   style="width:100%">
                            <el-option v-for="item in visitCityArr" :key="item.name" :label="item.name"
                                       :value="item.name"></el-option>
                        </el-select>
                        </el-form-item>

                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="是否签约" :label-width="formLabelWidth" prop="isSign" clearable>
                            <el-select v-model="addVisitRecord.isSign" placeholder="请选择" @change="showNotSignReason"
                                       style="width:100%">
                                <el-option v-for="item in isSignArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="到访人数" :label-width="formLabelWidth" prop="visitPeopleNum">
                            <el-input v-model="addVisitRecord.visitPeopleNum"
                                      type="number" min="1"
                                      oninput="if(value.length>2)value=value.slice(0,2)"
                                      onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                      autocomplete="off" maxLength="10"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="20">
                        <el-form-item label="未签约原因" style="display: none" id="notSignReason"
                                      :label-width="formLabelWidth" prop="notSignReason"
                                      :required="addVisitRecord.isSign == 0? true:false"
                                      :show-message="false"
                        >
                            <el-input type="textarea" v-model="addVisitRecord.notSignReason" maxlength="100" :rows="3"
                                      placeholder="请输入内容(限制100字)"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <!--<el-button type="primary" id="goSignButton" @click="goEditSign">去填写签约单</el-button>-->
                <el-button type="primary" @click="saveVisitRecord" :disabled="addVisitButtonAble">提交</el-button>
                <el-button @click="addVisitRecordDialogVisible = false">取消</el-button>
            </div>
        </template>
    </el-dialog>


    <!--编辑到访记录-->
    <el-dialog title="编辑到访记录" :visible.sync="updateVisitRecordDialogVisible" width="70%">
        <template>
            <el-form :model="updateVisitRecord" ref="updateVisitRecord" :rules="rulesVisit">
                <el-form-item label="驳回时间" :label-width="formLabelWidth">
                    <el-button size="mini" type="text" style="font-size: 17px;color: #1e2746">
                        {{updateVisitRecord.rebutTime}}
                    </el-button>
                </el-form-item>
                <el-form-item label="驳回原因" :label-width="formLabelWidth">
                    <span style="color: red; width:60%; word-wrap: break-word; word-break:break-all; ">{{updateVisitRecord.rebutReason}}</span>
                    <!-- <el-button size="mini"  type="text"  style="color: red">{{updateVisitRecord.rebutReason}}</el-button> -->
                </el-form-item>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="考察公司" :label-width="formLabelWidth" prop="companyid">
                            <el-select v-model="updateVisitRecord.companyid" placeholder="考察公司" clearable filterable
                                       style="width:100%">
                                <el-option v-for="item in companyArr" :key="item.id" :label="item.companyName"
                                           :value="item.id"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>

                    <el-col :span="10">
                        <el-form-item label="到访时间" :label-width="formLabelWidth" prop="vistitTime">
                            <el-date-picker v-model="updateVisitRecord.vistitTime" format="yyyy-MM-dd HH:mm"
                                            type="datetime" placeholder="选择日期时间" style="width:90%"></el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="客户姓名" :label-width="formLabelWidth" prop="customerName">
                            <el-input v-model="updateVisitRecord.customerName" autocomplete="off"
                                      maxlength="10"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="考察项目" :label-width="formLabelWidth" prop="projectId">
                            <el-select v-model="updateVisitRecord.projectId" placeholder="请选择" clearable filterable
                                       style="width:100%" @change="getVisitShopTypeEdit">
                                <el-option
                                        v-for="item in tasteProArr"
                                        :key="item.id"
                                        :label="item.projectName"
                                        :value="item.id">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>

                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="到访类型" :label-width="formLabelWidth" prop="visitType">
                            <el-select v-model="updateVisitRecord.visitType" clearable style="width:100%">
                                <el-option v-for="item in visitTypeArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="到访店铺类型" :label-width="formLabelWidth" prop="vistitStoreType">
                            <el-select v-model="updateVisitRecord.vistitStoreType" placeholder="请选择" clearable>
                                <el-option v-for="item in vistitStoreTypeArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="签约省份" :label-width="formLabelWidth" prop="signProvince">
                            <el-select v-model="updateVisitRecord.signProvince" placeholder="请选择"
                                       @change="changeUpdateVisitProvince" clearable style="width:100%">
                                <el-option v-for="item in provinceArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="签约城市" :label-width="formLabelWidth" prop="signCity" clearable filterable>
                            <el-select v-model="updateVisitRecord.signCity" placeholder="请选择"
                                       @change="changeUpdateVisitCity" style="width:100%">
                                <el-option v-for="item in cityArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="签约区/县" :label-width="formLabelWidth" prop="signDistrict">
                            <el-select v-model="updateVisitRecord.signDistrict" placeholder="请选择" clearable filterable
                                       style="width:100%">
                                <el-option v-for="item in districtArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="10">
                        <el-form-item label="到访城市" :label-width="formLabelWidth" prop="arrVisitCity">
                           <!-- <el-input v-model="updateVisitRecord.arrVisitCity" autocomplete="off"
                                      maxlength="50"></el-input>-->
                            <el-select v-model="updateVisitRecord.arrVisitCity" placeholder="请选择" clearable filterable
                                       style="width:100%">
                                <el-option v-for="item in visitCityArr" :key="item.name" :label="item.name"
                                           :value="item.name"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="10">
                        <el-form-item label="是否签约" :label-width="formLabelWidth" prop="isSign" clearable>
                            <el-select v-model="updateVisitRecord.isSign" placeholder="请选择" @change="showNotSignReason"
                                       style="width:100%">
                                <el-option v-for="item in isSignArr" :key="item.value" :label="item.name"
                                           :value="item.value"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <!--  <el-col :span="10">
                          <el-form-item label="到访人数"    :label-width="formLabelWidth"  prop="visitPeopleNum">
                              <el-input v-model="updateVisitRecord.visitPeopleNum" autocomplete="off"  maxlength="2"    ></el-input>
                          </el-form-item>
                      </el-col>-->
                </el-row>
                <el-row :gutter="20">
                    <el-col :span="20">
                        <div v-if="updateVisitRecord.isSign === 0">
                            <el-form-item label="未签约原因" :label-width="formLabelWidth" id="notSignReason"
                                          prop="notSignReason"
                                          :required="addVisitRecord.isSign == 0? true:false"
                                          :show-message="false"
                                >
                                <el-input type="textarea" v-model="updateVisitRecord.notSignReason" maxlength="100"
                                          :rows="3" placeholder="请输入内容(限制100字)"></el-input>
                            </el-form-item>
                        </div>
                        <div v-else-if="updateVisitRecord.isSign === 1">
                            <el-form-item label="未签约原因" style="display: none" :label-width="formLabelWidth"
                                          id="notSignReason" prop="notSignReason">
                                <el-input type="textarea" v-model="updateVisitRecord.notSignReason" maxlength="100"
                                          :rows="3" placeholder="请输入内容(限制100字)"></el-input>
                            </el-form-item>
                        </div>
                    </el-col>

                </el-row>
            </el-form>

            <div slot="footer" class="dialog-footer">
                <!--<el-button type="primary" @click="goUpdateEditSign">去填写签约单</el-button>-->
                <el-button type="primary" @click="updateVisitRecordMethod" :disabled="updateVisitButtonAble">提交
                </el-button>
                <el-button @click="updateVisitRecordDialogVisible = false">取消</el-button>
            </div>
        </template>
    </el-dialog>

    <!--
        到访记录展示  这个需要放到一个单独的页面中
     -->
    <el-dialog title="到访记录审核中" :visible.sync="showVisitAduitDialogVisible" width="70%">
        <template>
            <div v-show="showVisitAduitDatas.oneShow">
                <el-button size="mini" type="text" style="color: #1e2746">首次到访</el-button>
                <el-table :data="showVisitAduitDatas.one" style="width: 100%" tooltip-effect="dark" ref="multipleTable">
                    <el-table-column prop="customerName" label="客户姓名" width="100" align="center"></el-table-column>
                    <el-table-column prop="projectName" label="考察项目" width="100" align="center"></el-table-column>
                    <el-table-column prop="companyName" label="考察公司" width="100" align="center"></el-table-column>
                    <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                     align="center"></el-table-column>
                    <el-table-column prop="signProvince" label="预签约省份" width="100" align="center"></el-table-column>
                    <el-table-column prop="signCity" label="预签约市" width="100" align="center"></el-table-column>
                    <el-table-column prop="signDistrict" label="预签约区/县" align="center" width="120"></el-table-column>
                    <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" align="center"
                                     width="120"></el-table-column>
                    <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.visitType == 1">
                                预约来访
                            </div>
                            <div v-else-if="scope.row.visitType == 2">
                                慕名来访
                            </div>
                            <div v-else-if="scope.row.visitType == 3">
                                临时来访
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="arrVisitCity" label="到访城市" width="100" align="center"></el-table-column>
                    <el-table-column prop="visitPeopleNum" label="到访人数" align="center"></el-table-column>
                    <el-table-column prop="createTime" label="创建时间" width="100" align="center"></el-table-column>
                    <el-table-column prop="createUserName" label="创建人" width="100" align="center"></el-table-column>
                    <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.isSign === 0">
                                否
                            </div>
                            <div v-else-if="scope.row.isSign ===1">
                                是
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="status" label="到访有效性" align="center" width="100">
                        <template slot-scope="scope">
                            <div v-if="scope.row.status === 1">
                                审核中
                            </div>
                            <div v-else-if="scope.row.status ===2">
                                有效
                            </div>
                            <div v-else-if="scope.row.status ===0">
                                无效
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <p v-show="showVisitAduitDatas.oneNotSignShow" style="color: #1e2746">
                    未签约原因：{{showVisitAduitDatas.oneNotSignReason}}</p>
                <p v-show="showVisitAduitDatas.oneRebutShow" style="color:red">
                    驳回原因：{{showVisitAduitDatas.oneRebutReason}}</p>
            </div>
            <br>
            <div v-show="showVisitAduitDatas.twoShow">
                <el-button size="mini" type="text" style="color: #1e2746">2次到访</el-button>
                <el-table :data="showVisitAduitDatas.two" style="width: 100%" tooltip-effect="dark" ref="multipleTable">
                    <el-table-column prop="customerName" label="客户姓名" width="100" align="center"></el-table-column>
                    <el-table-column prop="projectName" label="考察项目" width="100" align="center"></el-table-column>
                    <el-table-column prop="companyName" label="考察公司" width="100" align="center"></el-table-column>
                    <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                     align="center"></el-table-column>
                    <el-table-column prop="signProvince" label="预签约省份" width="100" align="center"></el-table-column>
                    <el-table-column prop="signCity" label="预签约市" width="100" align="center"></el-table-column>
                    <el-table-column prop="signDistrict" label="预签约区/县" width="120" align="center"></el-table-column>
                    <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" width="120"
                                     align="center"></el-table-column>
                    <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.visitType == 1">
                                预约来访
                            </div>
                            <div v-else-if="scope.row.visitType == 2">
                                慕名来访
                            </div>
                            <div v-else-if="scope.row.visitType == 3">
                                临时来访
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="arrVisitCity" label="到访城市" width="100" align="center"></el-table-column>
                    <el-table-column prop="visitPeopleNum" label="到访人数" width="100" align="center"></el-table-column>
                    <el-table-column prop="createTime" label="创建时间" width="100" align="center"></el-table-column>
                    <el-table-column prop="createUserName" label="创建人" width="100" align="center"></el-table-column>
                    <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.isSign === 0">
                                否
                            </div>
                            <div v-else-if="scope.row.isSign ===1">
                                是
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="status" label="到访有效性" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.status === 1">
                                审核中
                            </div>
                            <div v-else-if="scope.row.status ===2">
                                有效
                            </div>
                            <div v-else-if="scope.row.status ===0">
                                无效
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
                <p v-show="showVisitAduitDatas.twoNotSignShow" style="color: #1e2746">
                    未签约原因：{{showVisitAduitDatas.twoNotSignReason}}</p>
                <p v-show="showVisitAduitDatas.twoRebutShow" style="color: red">
                    驳回原因：{{showVisitAduitDatas.twoRebutReason}}</p>
            </div>
            <br>
            <div v-show="showVisitAduitDatas.threeShow">
                <el-button size="mini" type="text" style="color: #1e2746">多次到访</el-button>
                <el-table :data="showVisitAduitDatas.three" style="width: 100%" tooltip-effect="light"
                          ref="multipleTable">
                    <el-table-column prop="customerName" label="客户姓名" width="100" align="center"></el-table-column>
                    <el-table-column prop="projectName" label="考察项目" width="100" align="center"></el-table-column>
                    <el-table-column prop="companyName" label="考察公司" width="100" align="center"></el-table-column>
                    <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                     align="center"></el-table-column>
                    <el-table-column prop="signProvince" label="预签约省份" width="100" align="center"></el-table-column>
                    <el-table-column prop="signCity" label="预签约市" width="100" align="center"></el-table-column>
                    <el-table-column prop="signDistrict" label="预签约区/县" width="120" align="center"></el-table-column>
                    <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" width="120"
                                     align="center"></el-table-column>
                    <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.visitType == 1">
                                预约来访
                            </div>
                            <div v-else-if="scope.row.visitType == 2">
                                慕名来访
                            </div>
                            <div v-else-if="scope.row.visitType == 3">
                                临时来访
                            </div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="arrVisitCity" label="到访城市" width="100" align="center"></el-table-column>
                    <el-table-column prop="visitPeopleNum" label="到访人数" width="100" align="center"></el-table-column>
                    <el-table-column prop="createTime" label="创建时间" width="100" align="center"></el-table-column>
                    <el-table-column prop="createUserName" label="创建人" width="100" align="center"></el-table-column>
                    <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.isSign === 0">
                                否
                            </div>
                            <div v-else-if="scope.row.isSign ===1">
                                是
                            </div>
                        </template>
                    </el-table-column>

                    <el-table-column prop="notSignReason" label="未签约原因" width="200" show-overflow-tooltip="true"
                                     align="center"></el-table-column>
                    <el-table-column prop="rebutReason" label="驳回原因" width="200" show-overflow-tooltip="true"
                                     align="center"></el-table-column>

                    <el-table-column prop="status" label="到访有效性" width="100" align="center">
                        <template slot-scope="scope">
                            <div v-if="scope.row.status === 1">
                                审核中
                            </div>
                            <div v-else-if="scope.row.status ===2">
                                有效
                            </div>
                            <div v-else-if="scope.row.status ===0">
                                无效
                            </div>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </template>
    </el-dialog>

    <el-dialog title="添加签约单信息" width="870px" :visible.sync="dialogFormSigningVisible" :close-on-click-modal="false">
        <template>
            <el-form :model="formSigning" ref="formSigning" :rules="rules">
                <div class="fs16 marginB20">签约单信息</div>
                <div>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="客户姓名：" :label-width="formLabelWidth" prop="customerName">
                                <el-input v-model="formSigning.customerName" maxLength="10"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="客户身份证号：" :label-width="formLabelWidth" prop="idCard">
                                <el-input v-model="formSigning.idCard" maxLength="20"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="客户联系电话：" :label-width="formLabelWidth" prop="phone">
                                <el-input v-model="formSigning.phone" maxLength="50" placeholder="填写多个电话使用逗号分隔开" onkeyup="this.value=this.value.replace(/[^\d\,，]/g,'')"></el-input>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="签约餐饮公司：" :label-width="formLabelWidth" prop="signCompanyId">
                                <el-select v-model="formSigning.signCompanyId" clearable filterable placeholder="请选择签约餐饮公司"
                                           style="width:100%">
                                    <el-option v-for="item in companyArr" :key="item.id" :label="item.companyName"
                                               :value="item.id"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="签约项目：" :label-width="formLabelWidth" prop="signProjectId">
                                <el-select v-model="formSigning.signProjectId" clearable filterable  placeholder="请选择" style="width:100%" @change="getShopType">
                                    <el-option v-for="item in signProjectList" :key="item.id" :label="item.projectName"
                                               :value="item.id"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="签约省份：" :label-width="formLabelWidth" prop="signProvince">
                                <el-select v-model="formSigning.signProvince" placeholder="请选择签约省份"
                                           @change="changeSignProvince" style="width:100%">
                                    <el-option v-for="item in provinceArr" :key="item.name" :label="item.name"
                                               :value="item.name"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="签约城市：" :label-width="formLabelWidth" prop="signCity">
                                <el-select v-model="formSigning.signCity" clearable placeholder="请选择签约城市："
                                           @change="changeSignCity" style="width:100%">
                                    <el-option v-for="item in cityArr" :key="item.name" :label="item.name"
                                               :value="item.name"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="签约区/县：" :label-width="formLabelWidth" prop="signDictrict">
                                <el-select v-model="formSigning.signDictrict" clearable placeholder="请选择签约区/县" style="width:100%">
                                    <el-option v-for="item in districtArr" :key="item.name" :label="item.name"
                                               :value="item.name"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="签约店型：" :label-width="formLabelWidth" prop="signShopType">
                                <el-select v-model="formSigning.signShopType" clearable filterable placeholder="请选择" style="width:100%">
                                    <el-option v-for="item in signStoreTypeArr" :key="item.value" :label="item.name"
                                               :value="item.value"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="合同应收金额：" :label-width="formLabelWidth" prop="amountReceivable">
                                <el-input v-model="formSigning.amountReceivable" type="number"
                                          oninput="if(value.length>10)value=value.slice(0,10)" min="0"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="签约类型：" :label-width="formLabelWidth" prop="signType">
                                <el-select v-model="formSigning.signType" @change="selectSigningType"
                                           placeholder="请选择签约类型：" style="width:100%;">
                                    <el-option
                                            v-for="item in option2s"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="是否远程签约：" :label-width="formLabelWidth" prop="isRemoteSign">
                                <el-select v-model="formSigning.isRemoteSign" placeholder="请选择是否远程签约：" @change="selectIsRemoteSign" style="width:100%;">
                                    <el-option
                                            v-for="item in isSignArr"
                                            :key="item.value"
                                            :label="item.name"
                                            :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
                <div v-if="isshowVisit">
                    <!--<div class="paddB20">补充到访记录<i class="el-icon-caret-bottom" @click="suppShow"></i><i class="el-icon-caret-top" @click="suppHide"></i><span style="font-size:14px;color: #ccc;">(若无到访记录可不填写)</span></div>-->
                    <el-button v-if="shouAddVisitButton" type="text" @click="suppShow">添加补充到访记录</el-button>
                    <el-button v-if="!shouAddVisitButton" type="text" @click="suppHide">取消添加</el-button>
                    <span style="font-size:14px;color: #ccc;">(若无到访记录可不填写)</span>
                    <div v-if="suppWrap">
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="到访时间：" :label-width="formLabelWidth" prop="visitTime">
                                    <el-date-picker
                                            type="datetime"
                                            format="yyyy-MM-dd HH:mm"
                                            placeholder="选择日期"
                                            v-model="formSigning.visitTime" style="width: 100%;"></el-date-picker>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="到访城市：" :label-width="formLabelWidth" prop="arrVisitCity">
                               <!--     <el-input v-model="formSigning.arrVisitCity" maxLength="50">
                                    </el-input>-->
                                    <el-select v-model="formSigning.arrVisitCity" placeholder="请选择" clearable
                                               style="width:100%">
                                        <el-option v-for="item in visitCityArr" :key="item.name" :label="item.name"
                                                   :value="item.name"></el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="到访类型：" :label-width="formLabelWidth" prop="visitType">
                                    <el-select v-model="formSigning.visitType" placeholder="请选择到访类型" style="width:100%">
                                        <el-option
                                                v-for="item in visitTypeArr"
                                                :key="item.value"
                                                :label="item.name"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                            <el-col :span="12">
                                <el-form-item label="到访店铺类型：" :label-width="formLabelWidth" prop="visitShopType">
                                    <el-select v-model="formSigning.visitShopType" placeholder="请选择到访店铺类型"
                                               style="width:100%">
                                        <el-option
                                                v-for="item in vistitStoreTypeArr"
                                                :key="item.value"
                                                :label="item.name"
                                                :value="item.value">
                                        </el-option>
                                    </el-select>
                                </el-form-item>
                            </el-col>
                        </el-row>
                        <el-row>
                            <el-col :span="12">
                                <el-form-item label="到访人数：" :label-width="formLabelWidth" prop="visitNum">
                                    <el-input v-model="formSigning.visitNum" type="number" min="1" maxLength="2"
                                              oninput="if(value.length>2)value=value.slice(0,2)"
                                              onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                              style="width:80%">
                                    </el-input>
                                    <span style="padding-left: 10px;">人</span>
                                </el-form-item>
                            </el-col>
                        </el-row>
                    </div>
                </div>
                <div class="paddB20">付款明细</div>
                <div>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="付款类型：" :label-width="formLabelWidth" prop="payType">
                                <el-select v-model="formSigning.payType" placeholder="请选择签约付款类型" disabled
                                           style="width:100%">
                                    <el-option key="1" label="全款" value="1"></el-option>
                                    <el-option key="2" label="定金" value="2"></el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="付款人姓名：" :label-width="formLabelWidth" prop="payName">
                                <el-input v-model="formSigning.payName" maxLength="10"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="付款时间：" :label-width="formLabelWidth" prop="payTime">
                                <el-date-picker
                                        type="date"
                                        format="yyyy-MM-dd"
                                        placeholder="选择日期"
                                        v-model="formSigning.payTime"
                                        style="width: 100%;"></el-date-picker>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="付款方式：" :label-width="formLabelWidth" prop="payModes">
                                <el-select v-model="formSigning.payModes" multiple placeholder="请选择付款方式：" style="width:100%">
                                    <el-option
                                            v-for="item in option3s"
                                            :key="item.value"
                                            :label="item.label"
                                            :value="item.name">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row v-if="isAllMoney">
                        <el-col :span="12">
                            <el-form-item label="余款金额：" :label-width="formLabelWidth" prop="amountBalance">
                                <!-- <el-input maxLength="10" v-model="formSigning.amountBalance" min="0" type="number" oninput="if(value.length>10)value=value.slice(0,10)"   style="width: 80%;"></el-input> -->
                                <el-input maxLength="10" v-model="formSigning.amountBalance" min="0"
                                          oninput="if(value.length>10)value=value.slice(0,10)" @keyup.native="number"
                                          style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="预计余款补齐时间：" :label-width="formLabelWidth" prop="makeUpTime"
                                          style="width:100%">
                                <el-date-picker
                                        type="date"
                                        format="yyyy-MM-dd"
                                        placeholder="选择日期"
                                        v-model="formSigning.makeUpTime"
                                        style="width: 100%;"></el-date-picker>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="实收金额：" :label-width="formLabelWidth" prop="amountReceived">
                                <!-- <el-input maxLength="10" v-model="formSigning.amountReceived"  type="number"  min="0" oninput="if(value.length>10)value=value.slice(0,10)"  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"  style="width: 80%;" @change="setAddPerformanceAmount"></el-input> -->
                                <el-input maxLength="10" v-model="formSigning.amountReceived" type="number" min="0"
                                          oninput="if(value.length>10)value=value.slice(0,10)"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          style="width: 80%;" @input="formSigningAmountPerformance"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                        <el-col :span="12">
                            <el-form-item label="实收设备金额：" :label-width="formLabelWidth" prop="amountEquipment">
                                <el-input maxLength="10" v-model="formSigning.amountEquipment" type="number" min="0"
                                          oninput="if(value.length>10)value=value.slice(0,10)"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          style="width: 80%;" @input="formSigningAmountPerformance"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="业绩金额：" :label-width="formLabelWidth" prop="performanceAmount">
                                <!-- <el-input maxLength="10" v-model="formSigningAmountPerformance"  type="number"  min="0" oninput="if(value.length>10)value=value.slice(0,10)"  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"  style="width: 80%;"></el-input> -->
                                <el-input maxLength="10" v-model="formSigning.performanceAmount" @keyup.native="number3"
                                          min="0" style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>                    
                        <el-col :span="12">
                            <el-form-item label="招商政策优惠金额：" :label-width="formLabelWidth" prop="preferentialAmount">
                                <el-input v-model="formSigning.preferentialAmount" type="number" min="0"
                                          oninput="if(value.length>10)value=value.slice(0,10)"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="路费（报首次）：" :label-width="formLabelWidth" prop="firstToll">
                                <el-input @input="formSigningAmountPerformance" v-model="formSigning.firstToll"
                                          type="number" min="0" oninput="if(value.length>10)value=value.slice(0,10)"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>                    
                        <el-col :span="12">
                            <el-form-item label="赠送金额：" :label-width="formLabelWidth" prop="giveAmount">
                                <el-input v-model="formSigning.giveAmount" placeholder="填写售价，非成本价" type="number" min="0"
                                          oninput="if(value.length>10)value=value.slice(0,10)"
                                          onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                          autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                <span style="padding-left: 10px;">元</span>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="12">
                            <el-form-item label="赠送类型：" :label-width="formLabelWidth" prop="giveType">
                                <el-select v-model="formSigning.giveType" clearable placeholder="请选择赠送类型：" style="width:100%;">
                                    <el-option
                                        v-for="item in giveTypeList"
                                        :key="item.value"
                                        :label="item.name"
                                        :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-form-item>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="24">
                            <el-form-item label="备注" :label-width="formLabelWidth">
                                <el-input type="textarea" v-model="formSigning.remarks" maxLength="200"></el-input>
                            </el-form-item>
                        </el-col>
                    </el-row>
                </div>
            </el-form>
            <div slot="footer" class="dialog-footer f-tac">
                <el-button type="primary" @click="submitForm('formSigning')" :disabled="addSignButtonAble">提 交
                </el-button>
                <el-button @click="dialogFormSigningVisible = false">取 消</el-button>
            </div>
        </template>
    </el-dialog>

    <el-dialog title="历史记录" :visible.sync="showHisVisitRecordDialog" width="70%">
        <template>
            <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
                <el-tab-pane v-for="(item, index) in editableTabs" :key="item.name" :label="item.title"
                             :name="item.name">
                    <div v-show="!showTabNotVisitData">
                        <div v-show="showVisitAduitDatas.oneShow">
                            <el-button size="mini" type="text" style="color: #1e2746">首次到访</el-button>
                            <el-table :data="showVisitAduitDatas.one" style="width: 100%" tooltip-effect="dark"
                                      ref="multipleTable">
                                <el-table-column prop="customerName" label="客户姓名" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="projectName" label="考察项目" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="companyName" label="考察公司" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signProvince" label="预签约省份" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signCity" label="预签约市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signDistrict" label="预签约区/县" align="center"
                                                 width="120"></el-table-column>
                                <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" align="center"
                                                 width="120"></el-table-column>
                                <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.visitType == 1">预约来访</div>
                                        <div v-else-if="scope.row.visitType == 2">慕名来访</div>
                                        <div v-else-if="scope.row.visitType == 3">临时来访</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="arrVisitCity" label="到访城市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="visitPeopleNum" label="到访人数" align="center"></el-table-column>
                                <el-table-column prop="createTime" label="创建时间" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="createUserName" label="创建人" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.isSign === 0">否</div>
                                        <div v-else-if="scope.row.isSign ===1">是</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="status" label="到访有效性" align="center" width="100">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.status === 1">审核中</div>
                                        <div v-else-if="scope.row.status ===2">有效</div>
                                        <div v-else-if="scope.row.status ===0">无效</div>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <p v-show="showVisitAduitDatas.oneNotSignShow" style="color: #1e2746">
                                未签约原因：{{showVisitAduitDatas.oneNotSignReason}}</p>
                            <p v-show="showVisitAduitDatas.oneRebutShow" style="color:red">
                                驳回原因：{{showVisitAduitDatas.oneRebutReason}}</p>
                        </div>
                        <br>
                        <div v-show="showVisitAduitDatas.twoShow">
                            <el-button size="mini" type="text" style="color: #1e2746">2次到访</el-button>
                            <el-table :data="showVisitAduitDatas.two" style="width: 100%" tooltip-effect="dark"
                                      ref="multipleTable">
                                <el-table-column prop="customerName" label="客户姓名" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="projectName" label="考察项目" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="companyName" label="考察公司" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signProvince" label="预签约省份" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signCity" label="预签约市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signDistrict" label="预签约区/县" width="120"
                                                 align="center"></el-table-column>
                                <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" width="120"
                                                 align="center"></el-table-column>
                                <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.visitType == 1">预约来访</div>
                                        <div v-else-if="scope.row.visitType == 2">慕名来访</div>
                                        <div v-else-if="scope.row.visitType == 3">临时来访</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="arrVisitCity" label="到访城市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="visitPeopleNum" label="到访人数" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="createTime" label="创建时间" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="createUserName" label="创建人" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.isSign === 0">否</div>
                                        <div v-else-if="scope.row.isSign ===1">是</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="status" label="到访有效性" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.status === 1">审核中</div>
                                        <div v-else-if="scope.row.status ===2">有效</div>
                                        <div v-else-if="scope.row.status ===0">无效</div>
                                    </template>
                                </el-table-column>
                            </el-table>
                            <p v-show="showVisitAduitDatas.twoNotSignShow" style="color: #1e2746">
                                未签约原因：{{showVisitAduitDatas.twoNotSignReason}}</p>
                            <p v-show="showVisitAduitDatas.twoRebutShow" style="color: red">
                                驳回原因：{{showVisitAduitDatas.twoRebutReason}}</p>
                        </div>
                        <br>
                        <div v-show="showVisitAduitDatas.threeShow">
                            <el-button size="mini" type="text" style="color: #1e2746">多次到访</el-button>
                            <el-table :data="showVisitAduitDatas.three" style="width: 100%" tooltip-effect="light"
                                      ref="multipleTable">
                                <el-table-column prop="customerName" label="客户姓名" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="projectName" label="考察项目" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="companyName" label="考察公司" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="vistitTime" label="到访时间" width="100" :formatter="formatVisitTime"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signProvince" label="预签约省份" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signCity" label="预签约市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="signDistrict" label="预签约区/县" width="120"
                                                 align="center"></el-table-column>
                                <el-table-column prop="vistitStoreTypeName" label="到访店铺类型" width="120"
                                                 align="center"></el-table-column>
                                <el-table-column prop="visitType" label="到访类型" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.visitType == 1">预约来访</div>
                                        <div v-else-if="scope.row.visitType == 2">慕名来访</div>
                                        <div v-else-if="scope.row.visitType == 3">临时来访</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="arrVisitCity" label="到访城市" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="visitPeopleNum" label="到访人数" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="createTime" label="创建时间" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="createUserName" label="创建人" width="100"
                                                 align="center"></el-table-column>
                                <el-table-column prop="isSign" label="是否签约" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.isSign === 0">否</div>
                                        <div v-else-if="scope.row.isSign ===1">是</div>
                                    </template>
                                </el-table-column>
                                <el-table-column prop="notSignReason" label="未签约原因" width="200" show-overflow-tooltip
                                                 align="center"></el-table-column>
                                <el-table-column prop="rebutReason" label="驳回原因" width="200" show-overflow-tooltip
                                                 align="center"></el-table-column>
                                <el-table-column prop="status" label="到访有效性" width="100" align="center">
                                    <template slot-scope="scope">
                                        <div v-if="scope.row.status === 1">审核中</div>
                                        <div v-else-if="scope.row.status ===2">有效</div>
                                        <div v-else-if="scope.row.status ===0">无效</div>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                    <div v-show="showTabNotVisitData">
                        <el-table :data="notVisitData" style="width: 100%" tooltip-effect="dark" ref="multipleTable">
                            <el-table-column prop="customerName" label="客户姓名" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="projectName" label="考察项目" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="signProvince" label="预签约省份" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="signCity" label="预签约市" width="100" align="center"></el-table-column>
                            <el-table-column prop="signDistrict" label="预签约区/县" align="center"
                                             width="120"></el-table-column>
                            <el-table-column prop="createTime" label="创建时间" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="createUserName" label="创建人" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="notVisitReason" label="未到访原因" width="100"
                                             align="center"></el-table-column>
                            <el-table-column prop="status" label="未到访有效性" align="center" width="100">
                                <template slot-scope="scope">
                                    <div v-if="scope.row.status === 1">审核中</div>
                                    <div v-else-if="scope.row.status ===2">有效</div>
                                    <div v-else-if="scope.row.status ===0">无效</div>
                                </template>
                            </el-table-column>
                        </el-table>
                    </div>
                </el-tab-pane>
            </el-tabs>
        </template>
    </el-dialog>

    <el-dialog :title="signTitle" width="870px" :visible.sync="dialogUpdateFormSigningVisible" :close-on-click-modal="false">
        <template>
            <el-form :model="updateFormSigning" :rules="rules" ref="updateFormSigning">
                <!-- <div class="borderbox padding20 marginB20" v-for="item in updateFormSigning.signRejectRecordList">
                    <p class="marginB10"><span>驳回时间：</span><span v-if="item.createTime">{{item.createTime}}</span></p>
                    <p class="marginB10"><span>驳回人员：</span><span v-if="item.createUserName">{{item.createUserName}}</span></p>
                    <p style="overflow: hidden;color: red;"><span style="float: left;width: 70px;">驳回原因：</span><span style="float: left;width: 385px;" v-if="item.rejectReason">{{item.rejectReason}}</span></p>
                </div>  -->
                <el-tabs type="card" v-model="activeNameSigning" @tab-click="handleClickSigning">

                    <el-tab-pane :label="items.label" v-for="(items, index) in updateFormSigning.paydetailList" :key="items.name" :name="items.name">
                    <!-- <el-tab-pane :label="item.title" :key="item.name" v-for="(item, index) in form.map" :name="item.name">     -->
                    <!-- <el-tab-pane :label="item.title" v-for="(item, index) in editableTabs" :key="item.name" :name="item.name"> -->
                        <div class="borderbox padding20 marginB20" v-for="item in items.rejectRecordDtoList">
                            <p class="marginB10"><span>驳回人员：</span><span v-if="item.createUserName">{{item.createUserName}}</span></p>
                            <p class="marginB10"><span>驳回时间：</span><span v-if="item.createTime">{{item.createTime}}</span></p>
                            <p style="overflow: hidden;color: red;"><span style="float: left;width: 70px;">驳回原因：</span><span style="float: left;width: 385px;" v-if="item.rejectReason">{{item.rejectReason}}</span></p>
                        </div>

                        <div class="paddB20">签约单信息</div>
                        <div>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="签约单编号：" :label-width="formLabelWidth" prop="signNo">
                                        <el-input v-model="updateFormSigning.signNo" maxLength="20" disabled></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="客户姓名：" :label-width="formLabelWidth" prop="customerName">
                                        <el-input v-model="updateFormSigning.customerName"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="客户身份证号：" :label-width="formLabelWidth" prop="idCard">
                                        <el-input v-model="updateFormSigning.idCard" maxLength="20"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="客户联系电话：" :label-width="formLabelWidth" prop="phone">
                                        <el-input v-model="updateFormSigning.phone" maxLength="50" onkeyup="this.value=this.value.replace(/[^\d\,，]/g,'')"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="签约餐饮公司：" :label-width="formLabelWidth" prop="signCompanyId">
                                        <el-select v-model="updateFormSigning.signCompanyId" clearable filterable placeholder="请选择签约餐饮公司" style="width:100%;">
                                            <el-option v-for="item in companyArr" :key="item.id" :label="item.companyName"
                                                       :value="item.id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="签约项目：" :label-width="formLabelWidth" prop="signProjectId">
                                        <el-select clearable filterable v-model="updateFormSigning.signProjectId" placeholder="请选择" style="width:100%;" @change="getShopTypeEdit">
                                            <el-option v-for="item in projectArr" :key="item.id" :label="item.projectName"
                                                       :value="item.id"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="签约省份：" :label-width="formLabelWidth" prop="signProvince">
                                        <el-select v-model="updateFormSigning.signProvince" placeholder="请选择签约省份" @change="changeUpdateSignProvince" style="width:100%;">
                                            <el-option v-for="item in provinceArr" :key="item.name" :label="item.name" :value="item.name"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="签约城市：" :label-width="formLabelWidth" prop="signCity">
                                        <el-select v-model="updateFormSigning.signCity" placeholder="请选择签约城市：" clearable @change="changeUpdateSignCity" style="width:100%;">
                                            <el-option v-for="item in cityArr" :key="item.name" :label="item.name" :value="item.name"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="签约区/县：" :label-width="formLabelWidth" prop="signDictrict">
                                        <el-select clearable v-model="updateFormSigning.signDictrict" placeholder="请选择签约区/县" style="width:100%;">
                                            <el-option v-for="item in districtArr" :key="item.name" :label="item.name"
                                                       :value="item.name"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="签约店型：" :label-width="formLabelWidth" prop="signShopType">
                                        <el-select v-model="updateFormSigning.signShopType" placeholder="请选择" style="width:100%;">
                                            <el-option v-for="item in signStoreTypeArr" :key="item.value" :label="item.name" :value="item.value"></el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="合同应收金额：" :label-width="formLabelWidth" prop="amountReceivable">
                                        <el-input v-model="updateFormSigning.amountReceivable" type="number" min="0" oninput="if(value.length>10)value=value.slice(0,10)" onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))" autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="签约类型：" :label-width="formLabelWidth" prop="signType" style="width: 100%;">
                                        <el-select :disabled="notEditRebutSign" v-model="updateFormSigning.signType" @change="selectUpdateSigningType" placeholder="请选择签约类型：" style="width:100%">
                                            <el-option
                                                v-for="item in option2s"
                                                :key="item.value"
                                                :label="item.label"
                                                :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="是否远程签约：" :label-width="formLabelWidth" prop="isRemoteSign">
                                        <el-select v-model="updateFormSigning.isRemoteSign" placeholder="请选择是否远程签约：" style="width: 100%;" @change="updateSelectIsRemoteSign">
                                            <el-option
                                                    v-for="item in isSignArr"
                                                    :key="item.value"
                                                    :label="item.name"
                                                    :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </div>
                        <div v-if="updateIsshowVisit">
                            <!--<div class="paddB20">补充到访记录<i class="el-icon-caret-bottom" @click="suppShow"></i><i class="el-icon-caret-top" @click="suppHide"></i><span style="font-size:14px;color: #ccc;">(若无到访记录可不填写)</span></div>-->
                            <el-button v-if="shouAddVisitButton" type="text" @click="suppUpdateShow">添加补充到访记录</el-button>
                            <el-button v-if="!shouAddVisitButton" type="text" @click="suppUpdateHide">取消添加</el-button>
                            <span style="font-size:14px;color: #ccc;">(若无到访记录可不填写)</span>
                            <div v-if="suppWrap">
                                <el-row>
                                    <el-col :span="12">
                                        <el-form-item label="到访时间：" :label-width="formLabelWidth" prop="visitTime">
                                            <el-date-picker
                                                type="datetime"
                                                format="yyyy-MM-dd HH:mm"
                                                placeholder="选择日期"
                                                v-model="updateFormSigning.visitTime" style="width: 100%;"></el-date-picker>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="12">
                                        <el-form-item label="到访城市：" :label-width="formLabelWidth" prop="arrVisitCity">
                                            <el-select v-model="updateFormSigning.arrVisitCity" placeholder="请选择" clearable
                                                       style="width:100%">
                                                <el-option v-for="item in visitCityArr" :key="item.name" :label="item.name"
                                                           :value="item.name"></el-option>
                                            </el-select>

                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="12">
                                        <el-form-item label="到访类型：" :label-width="formLabelWidth" prop="visitType">
                                            <el-select v-model="updateFormSigning.visitType" placeholder="请选择到访类型" style="width:100%">
                                                <el-option
                                                    v-for="item in visitTypeArr"
                                                    :key="item.value"
                                                    :label="item.name"
                                                    :value="item.value">
                                                </el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                    <el-col :span="12">
                                        <el-form-item label="到访店铺类型：" :label-width="formLabelWidth" prop="visitShopType">
                                            <el-select v-model="updateFormSigning.visitShopType" placeholder="请选择到访店铺类型"
                                                       style="width:100%">
                                                <el-option
                                                    v-for="item in vistitStoreTypeArr"
                                                    :key="item.value"
                                                    :label="item.name"
                                                    :value="item.value">
                                                </el-option>
                                            </el-select>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                                <el-row>
                                    <el-col :span="12">
                                        <el-form-item label="到访人数：" :label-width="formLabelWidth" prop="visitNum">
                                            <el-input v-model="updateFormSigning.visitNum" type="number" min="1" maxLength="2"
                                                      oninput="if(value.length>2)value=value.slice(0,2)"
                                                      onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                                      style="width:80%">
                                            </el-input>
                                            <span style="padding-left: 10px;">人</span>
                                        </el-form-item>
                                    </el-col>
                                </el-row>
                            </div>
                        </div>
                        <div class="paddB20">付款明细</div>
                        <div>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="付款类型：" :label-width="formLabelWidth" prop="payType">
                                        <el-select v-model="updateFormSigning.payType" :disabled="payTypeSelect"
                                                   placeholder="请选择签约付款类型" @change="changePayType" style="width:100%;">
                                            <el-option
                                                    v-for="item in payTypeArr"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="付款人姓名：" :label-width="formLabelWidth" prop="payName">
                                        <el-input v-model="updateFormSigning.payName" maxLength="10"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="付款时间：" :label-width="formLabelWidth" prop="payTime" required>
                                        <el-date-picker
                                                type="date"
                                                format="yyyy-MM-dd"
                                                placeholder="选择日期"
                                                v-model="updateFormSigning.payTime" style="width: 100%;"></el-date-picker>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="付款方式：" :label-width="formLabelWidth" prop="payModes">
                                        <el-select v-model="updateFormSigning.payModes" multiple placeholder="请选择付款方式："
                                                   style="width:100%;">
                                            <el-option
                                                    v-for="item in option3s"
                                                    :key="item.value"
                                                    :label="item.label"
                                                    :value="item.name">
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row v-if="isAllMoney">
                                <el-col :span="12">
                                    <el-form-item label="余款金额：" :label-width="formLabelWidth" prop="amountBalance">
                                        <!-- <el-input  maxLength="10" v-model="updateFormSigning.amountBalance" style="width: 80%;"  type="number"  min="0" oninput="if(value.length>10)value=value.slice(0,10)"  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"></el-input> -->
                                        <el-input maxLength="10" v-model="updateFormSigning.amountBalance" style="width: 80%;"
                                                  type="number" min="0" oninput="if(value.length>10)value=value.slice(0,10)"
                                                  @keyup.native="number2"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="预计余款补齐时间：" :label-width="formLabelWidth" prop="makeUpTime">
                                        <el-date-picker
                                            type="date"
                                            format="yyyy-MM-dd"
                                            placeholder="选择日期"
                                            v-model="updateFormSigning.makeUpTime"
                                            style="width: 100%;"></el-date-picker>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="实收金额：" :label-width="formLabelWidth" prop="amountReceived">
                                        <el-input maxLength="10" @input="updateFormSigningAmountPerformance"
                                                  v-model="updateFormSigning.amountReceived" style="width: 80%;" type="number"
                                                  min="0" oninput="if(value.length>10)value=value.slice(0,10)"
                                                  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="实收设备金额：" :label-width="formLabelWidth" prop="amountEquipment">
                                        <el-input maxLength="10" @input="updateFormSigningAmountPerformance"
                                                  v-model="updateFormSigning.amountEquipment" style="width: 80%;" type="number"
                                                  min="0" oninput="if(value.length>10)value=value.slice(0,10)"
                                                  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>    
                                <el-col :span="12">
                                    <el-form-item label="业绩金额：" :label-width="formLabelWidth" prop="amountPerformance">
                                        <el-input maxLength="10" v-model="updateFormSigning.amountPerformance"
                                                  @keyup.native="number4" min="0" style="width: 80%;"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>                            
                                <el-col :span="12">
                                    <el-form-item label="招商政策优惠金额：" :label-width="formLabelWidth" prop="preferentialAmount">
                                        <el-input v-model="updateFormSigning.preferentialAmount"
                                                  type="number" min="0" oninput="if(value.length>10)value=value.slice(0,10)"
                                                  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                                  autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="路费（报首次）：" :label-width="formLabelWidth" prop="firstToll">
                                        <el-input  @input="updateFormSigningAmountPerformance"
                                                  v-model="updateFormSigning.firstToll" type="number" min="0"
                                                  oninput="if(value.length>10)value=value.slice(0,10)"
                                                  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                                  autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>                            
                                <el-col :span="12">
                                    <el-form-item label="赠送金额：" :label-width="formLabelWidth" prop="giveAmount">
                                        <el-input  placeholder="填写售价，非成本价"
                                                  v-model="updateFormSigning.giveAmount" type="number" min="0"
                                                  oninput="if(value.length>10)value=value.slice(0,10)"
                                                  onkeypress="return(/[\d]/.test(String.fromCharCode(event.keyCode)))"
                                                  autocomplete="off" maxLength="10" style="width: 80%;"></el-input>
                                        <span style="padding-left: 10px;">元</span>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label="赠送类型：" :label-width="formLabelWidth" prop="giveType">
                                        <el-select clearable v-model="updateFormSigning.giveType"  placeholder="请选择赠送类型："
                                                   style="width:100%;">
                                            <el-option
                                                v-for="item in giveTypeList"
                                                :key="item.value"
                                                :label="item.name"
                                                :value="item.value">
                                            </el-option>
                                        </el-select>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="备注：" :label-width="formLabelWidth">
                                        <el-input type="textarea" v-model="updateFormSigning.remarks"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </div>
                    </el-tab-pane>                    
                </el-tabs>
            </el-form>
            <div class="dialog-footer f-tac">
                <el-button type="primary" @click="submitUpdateForm('updateFormSigning')"
                           :disabled="updateSignButtonAble">提交
                </el-button>
                <el-button @click="dialogUpdateFormSigningVisible = false">取 消</el-button>
            </div>
        </template>
    </el-dialog>
    <!--添加到访记录-->
    <el-dialog title="编辑驳回未到访" :visible.sync="editRebutNoVisitDialog" :close-on-click-modal="false" width="540px" @close="closeEditRebutNoVisitDialog">
        <template>
            <el-form :model="editRebutNoVisit" ref="editRebutNoVisit" :rules="editRebutNoVisitRules">
                <div class="borderbox padding10">
                    <p class="marginB10" v-if="showVisitId"><span>主键：{{editRebutNoVisit.id}}</span></p>
                    <p class="marginB10"><span>驳回时间：{{editRebutNoVisit.rejectTime}}</span></p>
                    <p class="marginB10"><span>驳回人员：{{editRebutNoVisit.rejectUser}}</span></p>
                    <p style="overflow: hidden;color: red;"><span style="float: left;width: 70px;">驳回原因：</span><span style="float: left;width: 385px;">{{editRebutNoVisit.rejectReason}}</span></p>
                </div>
                <p class="padding10" style="padding-bottom:0;">标记未到访时间：{{editRebutNoVisit.notVisitTime}}</p>
                <el-form-item label="未到访原因：" prop="notVisitReason" class="notVisitReasonFs14">
                    <el-input type="textarea" v-model="editRebutNoVisit.notVisitReason" maxlength="100" :rows="3"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="updateRejectNotVisit('editRebutNoVisit')" :disabled="updateRejectNotVisitButtonAble">保存</el-button>
            </div>
        </template>
    </el-dialog>

</div>

<!-- import common js-->
<div th:include="_footer_include :: #jsLib"></div>
<!--<script th:src="@{/js/excel/xlsx.min.js}" src="../static/js/excel/xlsx.min.js"></script>-->
<script th:inline="javascript">
   // var dzList = [[${teleGroupList}]];
   // var dxgwList = [[${teleSaleList}]];
    var proSelect = [[${proSelect}]];
    var proAllSelect = [[${proAllSelect}]];
    var loginUserId = [[${loginUserId}]];
    var giveTypeList = [[${giveTypeList}]];
    var businessLines =[[${businessLines}]];
    var testdata={
        "code": "0",
        "data": {
            "signId": "1194066625054400512",
            "signStatus": 0,
            "clueId": "1179582563371724800",
            "signNo": "NJTC2019111200001",
            "customerName": "30001001",
            "idCard": "1000",
            "phone": "122222",
            "signCompanyId": "1143331765491077120",
            "signCompanyName": "南京天策",
            "signProjectId": "1179367625101443072",
            "signProjectName": "姜项目",
            "signProvince": "安徽",
            "signCity": "安庆",
            "signDictrict": "迎江区",
            "signShopType": "1",
            "signShopTypeName": "旗舰店",
            "amountReceivable": 23232.00,
            // "firstToll": 232.00,
            // "preferentialAmount": 232.00,
            "signType": 2,
            // "giveAmount": 3232.00,
            "isRemoteSign": 0,
            "payDetailId": "1194066625054400513",
            // "payType": "2",
            // "payName": "30001001",
            // "payMode": "1",
            "payModes": [],
            // "payTime": "2019-11-12",
            // "amountReceived": 232.00,
            // "amountBalance": 232.00,
            // "makeUpTime": "2019-11-12",
            // "amountPerformance": 464.00,
            "performanceAmount": 464.00,
            "detailStatus": 0,
            "remarks": "备注list",
            // "createUser": "1170885656038285312",
            "visitNum": 1,
            "visitCity": "city",
            "visitTime": 1576132497893,
            "visitType": 1,
            // "statementNo": "0x59q0ts39",
            // "giveType": 1,
            "refundStatus": 1,
            "arrVisitCity": "arrVisitCity",
            "visitShopType": 1,
            "paydetailList": [
                {
                    "label":'定金',
                    // "name":'1',
                    "amountBalance": 8000,
                    "amountPerformance": 6300,
                    "amountReceived": 5800,
                    "createUser": "1126763779137347584",
                    "firstToll": 50,
                    "giveAmount": 80,
                    "giveType": 4,
                    "id": "1145054454245232641",
                    "makeUpTime": "2019-07-30",
                    "payMode": "5",
                    "payName": "测试1",
                    "payTime": "2019-06-20",
                    "payType": "2",
                    "preferentialAmount": 80,
                    "signId": "1145054454245232640",
                    "statementNo": "fr7ulqpzd8",
                    "status": 2,
                    "remarks": "123",
                    "rejectRecordDtoList": [
                      {
                        "id": 66962138.43021929,
                        "signId": 5643142.660537183,
                        "payDetailId": 47455777.909904696,
                        "rejectReason": "velit incididunt",
                        "createUser": 4131652.869510293,
                        "createUserName": "ad cillum dolor aliqua",
                        "createTime": "ex sed amet laboris proident",
                        "remarks":"备注定金"
                      }
                    ]
                },
                { 
                    "label":'追加定金',
                    // "name":'2',                   
                    "amountBalance": 5000,
                    "amountPerformance": 5896,
                    "amountReceived": 8000,
                    "createUser": "1126763779137347584",
                    "firstToll": 200,
                    "giveAmount": 90,
                    "giveType": 5,
                    "id": "1145055025660432384",
                    "makeUpTime": "2019-07-30",
                    "payMode": "3,4,",
                    "payName": "测试1",
                    "payTime": "2019-12-16",
                    "payType": "3",
                    "preferentialAmount": 80,
                    "signId": "1145054454245232640",
                    "statementNo": "k6uvxwwzis",
                    "status": 0,
                    "remarks": "3232",
                    "rejectRecordDtoList": [
                      {
                        "id": 66962138.43021929,
                        "signId": 5643142.660537183,
                        "payDetailId": 47455777.909904696,
                        "rejectReason": "velit incididunt2",
                        "createUser": 4131652.869510293,
                        "createUserName": "ad cillum dolor aliqua2",
                        "createTime": "ex sed amet laboris proident2",
                        "remarks":"备注追加定金"
                      }
                    ]
                }
            ]
        }
    };

    // 查询 模块
    var mainDivVM = new Vue({
        el: '#mainDiv',
        data: {
            businessLines:businessLines,
            disabledIsTailMoney:false,//默认可选
            disabledIsSign:false,//默认可选
            dataUrlParam:{
                dataUrlArr:[{
                    isActive:false,
                    name:"待处理客户",
                    url:"/aggregation/businessMyCustomer/initPendingList",                
                },{
                    isActive:false,
                    name:"未补齐尾款客户",
                    url:"/aggregation/businessMyCustomer/listPage?type=1",                
                },{
                    isActive:false,
                    name:"未签约客户",
                    url:"/aggregation/businessMyCustomer/listPage?type=2"
                },
                {
                    isActive:false,
                    name:"已签约客户",
                    url:"/aggregation/businessMyCustomer/listPage?type=3"
                }]
            },
            isElBreadcrumb:true,
            signTabIndex:0,//点击编辑签约单tab的index
            signTitle:'',    
            responseData:[],  
            activeNameSigning:'',     
            editRebutNoVisitDialog:false,//编辑驳回未到访弹窗
            showVisitId:false,
            editRebutNoVisit:{},
            paginationShow: false,
            giveTypeList: giveTypeList,
            isShow: false,
            loginUserId: loginUserId,
            editableTabsValue: 0, //tabs标签
            activeName: '',
            hisDatas: [],
            notVisitData: [],
            showTabNotVisitData: false,
            editableTabs: [],
            isshowVisit:true,//是否显示到访记录
            updateIsshowVisit:true,//驳回签约单是否显示到访记录
            suppWrap: true,
            notVisitButtonAble: false,
            addVisitButtonAble: false,
            addSignButtonAble: false,
            updateSignButtonAble: false,
            updateVisitButtonAble: false,
            updateRejectNotVisitButtonAble:false,
            tabIndex: 2,
            shouAddVisitButton: false,
            updateVisitRecordDialogVisible: false,
            addVisitRecordDialogVisible: false,
            notVisitdDialogVisible: false,
            notVisitdDialogVisible1: false,
            notVisitFlagDialogVisible: false,
            showVisitAduitDialogVisible: false,
            dialogFormSigningVisible: false,
            dialogUpdateFormSigningVisible: false,
            showHisVisitRecordDialog: false,
            existsSign: false,
            curSignStatus: "",
            isAllMoney: false,
            payTypeSelect: false,
            notEditRebutSign: false,
            formLabelWidth: "150px",
            formLabelWidth2: "98px",
            tableData: [],
            visitTableData: [],
            showVisitAduitDatas: {
                one: [],
                two: [],
                three: [],
                oneNotSignReason: "",
                twoNotSignReason: "",
                threeNotSignReason: "",
                oneRebutReason: "",
                twoRebutReason: "",
                threeRebutReason: "",
                oneShow: true,
                twoShow: false,
                threeShow: false,
                oneRebutShow: false,
                twoRebutShow: false,
                threeRebutShow: false,
                oneNotSignShow: false,
                twoNotSignShow: false,
                threeNotSignShow: false
            },
            teleketGroupArr: "",
            teleketSaleArr: "",
            tasteProArr: proAllSelect,
            signArr: [{value: 0, name: '未签约'}, {value: 1, name: '已签约'}],
            isSignArr: [{value: 0, name: '否'}, {value: 1, name: '是'}],
            visitArr: [{value: '', name: "全部"}, {value: -1, name: '待处理'}, {value: 0, name: '未到访'}, {
                value: 1,
                name: '首次到访'
            }, {value: 2, name: '2次到访'}, {value: 3, name: '3次到访'},{value: 4, name: '4次到访'},{value: 5, name: '5次到访'}],
            visitTypeArr: [{value: 1, name: '预约来访'}, {value: 2, name: '慕名来访'}, {value: 3, name: '临时来访'}],
            option2s: [{value: 1, label: '一次性全款'}, {value: 2, label: '先付定金'}],
            option3s: [],
            payTypeArr: [{value: "1", label: '全款'}, {value: "2", label: '定金'}, {value: "3", label: '追加定金'}, {

                value: "4",
                label: '尾款'
            }],
            payTypeArr1: [{value: "1", label: '全款'}, {value: "2", label: '定金'}, {
                value: "3",
                label: '追加定金'
            }, {value: "4", label: '尾款'}],
            isTailMoneyArr: [{value: '', label: '全部'}, {value: '0', label: '否'}, {value: '1', label: '是'}],
            vistitStoreTypeArr: [],
            signStoreTypeArr: [],
            provinceArr: [],
            districtArr: [],
            cityArr: [],
            companyArr: [],
            visitCityArr:[],
            projectArr: proSelect,
            signProjectList:[],
            multipleSelection: [],
            notVisitFlagRules: {
                notVisitReason: [
                    {required: true, message: '未到访原因为必填项', trigger: 'blur'},
                    {min: 1, max: 100, message: '长度在 1 到 100 个字符', trigger: 'blur'}
                ],
            },
            notVisitFlag: {
                clueId: "",
                str: "",
                clueIds: [],
                notVisitReason: "",
                createUserName:"",
                notVisitTime:""
            },
            editRebutNoVisit:{
                id: "",
                rejectTime: "",
                rejectUser: "",
                rejectReason: "",
                notVisitTime: "",
                notVisitReason: ""

            },
            queryForm: {
                visitStatus: "",
                isSign: "",
                teleGroupId: "",
                teleSaleId: "",
                tasteProjectId: "",
                cusName: "",
                reserveTime1: "",
                reserveTime2: "",
                appiontmentCreateTime1: "",
                appiontmentCreateTime2: "",
                allocateTime1: "",
                allocateTime2: "",
                isTailMoney: '',
                signNo:''
            },
            storeForm: {
                visitStatus: "",
                isSign: "",
                teleGroupId: "",
                teleSaleId: "",
                tasteProjectId: "",
                cusName: "",
                reserveTime1: "",
                reserveTime2: "",
                appiontmentCreateTime1: "",
                appiontmentCreateTime2: "",
                allocateTime1: "",
                allocateTime2: "",
                isTailMoney: '',
            },
            storeId: '',
            scrollTop: 0,//表格滚动位置
            addVisitRecord: {
                clueId: "",
                companyid: "",
                vistitTime: "",
                customerName: "",
                projectId: "",
                visitType: 1,
                vistitStoreType: "",
                signProvince: "",
                signCity: "",
                signDistrict: "",
                arrVisitCity: "",
                isSign: 1,
                visitPeopleNum: "",
                notSignReason: ""
            },
            updateVisitRecord: {
                id: "",
                clueId: "",
                companyid: "",
                vistitTime: "",
                customerName: "",
                projectId: "",
                visitType: 1,
                vistitStoreType: "",
                signProvince: "",
                signCity: "",
                signDistrict: "",
                arrVisitCity: "",
                isSign: 1,
                // visitPeopleNum:"",
                notSignReason: "",
                rebutTime: "",
                rebutReason: ""
            },
            formSigning: {
                giveType: "",
                clueId: "",
                signNo: '',
                customerName: '',
                idCard: '',
                phone: '',
                signCompanyId: '',
                signProjectId: '',
                signProvince: '',
                signCity: '',
                signDictrict: '',
                signShopType: '',
                amountReceivable: '',
                firstToll: '',
                preferentialAmount: '',
                signType: 1,
                giveAmount: '',
                isRemoteSign: '',

                visitTime: "",
                arrVisitCity: "",
                visitType: "",
                visitShopType: "",
                visitNum: "",

                payType: 1,
                payModes: [],
                payMode: '',
                amountReceived: '',
                amountBalance: '',
                makeUpTime: null,
                payTime: new Date(),
                amountPerformance: '',
                performanceAmount: '',
                payName:'',
                amountEquipment:"",//实收设备金额
            },
            updateFormSigning: {
                giveType: "",
                signId: "",
                clueId: "",
                signNo: '',
                customerName: "",
                idCard: '',
                phone: '',
                signCompanyId: '',
                signProjectId: '',
                signProvince: '',
                signCity: '',
                signDictrict: '',
                signShopType: '',
                amountReceivable: '',
                firstToll: '',
                preferentialAmount: '',
                signType: "1",
                giveAmount: '',
                rebutTime: "",
                rebutReason: "",
                isRemoteSign: 0,

                visitDetailRecordId:"",
                visitTime: "",
                arrVisitCity: "",
                visitType: "",
                visitShopType: "",
                visitNum: "",

                payDetailId: "",
                payType: '1',
                payName: '',
                payModes: [],
                payMode: '',
                amountReceived: '',
                amountBalance: '',
                makeUpTime: null,
                payTime: null,
                amountPerformance: '',
                performanceAmount: '',
                remarks: '', //备注
                signRejectRecordList:[],//驳回原因
                amountEquipment:'',//实收设备金额
            },
            pager: {
                total: 0,
                currentPage: 1,
                pageSize: 20,
            },
            rulesVisit: {
                companyid: [
                    {required: true, message: '请选择考察公司', trigger: 'change'}
                ],
                vistitTime: [
                    {required: true, message: '请选择到访时间', trigger: 'change'}
                ],
                projectId: [
                    {required: true, message: '请选择考察项目', trigger: 'change'}
                ],
                vistitStoreType: [
                    {required: true, message: '请选择到访店铺类型', trigger: 'change'}
                ],
                visitType: [
                    {required: true, message: '请选择到访类型', trigger: 'change'}
                ],
                isSign: [
                    {required: true, message: '请选择是否签约', trigger: 'change'}
                ],
                signProvince: [
                    {required: true, message: '请选择签约省份', trigger: 'change'}
                ],
                customerName: [
                    {required: true, message: '请输入客户姓名', trigger: 'blur'}
                ],
                arrVisitCity: [ //请填写来访城市
                    {required: true, message: '请填写到访城市', trigger: 'change'}
                ],
                signShopType: [
                    {required: true, message: '请选择签约店型', trigger: 'change'}
                ],
                visitPeopleNum: [ //请填写到访人数
                    {required: true, message: '请填写到访人数', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请填写到访人数"));
                                mainDivVM.addVisitRecord.visitPeopleNum = "";

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.addVisitRecord.visitPeopleNum = "";
                            } else {
                                callback();
                            }

                        }, trigger: 'change'
                    }
                ]
            },
            rules: {

                customerName: [
                    {required: true, message: '请输入客户姓名', trigger: 'blur'}
                ],
                idCard: [
                    {required: true, message: '请输入客户身份证号', trigger: 'blur'}
                ],
                phone: [
                    {required: true, message: '请输入客户联系电话', trigger: 'blur'}
                ],
                signCompanyId: [
                    {required: true, message: '请选择签约餐饮公司', trigger: 'change'}
                ],
                signProjectId: [
                    {required: true, message: '请选择签约项目', trigger: 'change'}
                ],
                signProvince: [
                    {required: true, message: '请选择签约省份', trigger: 'change'}
                ],
                signShopType: [
                    {required: true, message: '请选择签约店型', trigger: 'change'}
                ],
                amountReceivable: [
                    {required: true, message: '请输入合同应收金额', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入合同应收金额"));
                                mainDivVM.formSigning.amountReceivable = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.formSigning.amountReceivable = null;
                            } else {
                                callback();
                            }
                        }, trigger: 'change'
                    }
                ],
                firstToll: [
                    {required: true, message: '请输入路费（报首次）', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入路费（报首次）"));
                                mainDivVM.formSigning.firstToll = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.formSigning.firstToll = null;
                            } else {
                                callback();
                            }
                        }, trigger: 'change'
                    }
                ],
                preferentialAmount: [
                    {required: true, message: '请输入招商政策优惠金额', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入招商政策优惠金额"));
                                mainDivVM.formSigning.preferentialAmount = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.formSigning.preferentialAmount = null;
                            } else {
                                callback();
                            }

                        }, trigger: 'change'
                    }
                ],
                signType: [
                    {required: true, message: '请选择签约类型', trigger: 'change'}
                ],
                giveAmount: [
                    {required: true, message: '请输入赠送金额', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入赠送金额"));
                                mainDivVM.formSigning.giveAmount = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.formSigning.giveAmount = null;
                            } else {
                                callback();
                            }
                        }, trigger: 'change'
                    }
                ],
                // payType: [
                //  { required: true, message: '请选择付款类型', trigger: 'change' }
                // ],
                payMode: [
                    {required: true, message: '请选择付款方式', trigger: 'change'}
                ],
                payModes: [
                    { required: true,validator:function(rule,value,callback){
                            if(value.length==0){
                                callback(new Error("请选择付款方式"));
                            }else{
                                callback();
                            }
                        }, trigger: 'change' }
                ],
                payName: [
                    {required: true, message: '请输入付款人姓名', trigger: 'blur'}
                ],
                payTime: [
                    // {type: 'date', required: true, message: '请选择时间', trigger: 'change'}
                    { required: true, message: '请选择时间', trigger: 'change'}
                ],
                amountReceived: [
                    {required: true, message: '请输入实收金额', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入实收金额"));
                                // mainDivVM.formSigning.amountReceived =null;
                                return;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                // mainDivVM.formSigning.amountReceived =null;
                                return;
                            } else {
                                callback();
                            }
                        }, trigger: 'change'
                    }
                ],
                amountBalance: [
                    {
                        required: true, validator: function (rule, value, callback) {
                            if (value === 0) {
                                callback();
                            }
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入余款金额"));
                                // mainDivVM.formSigning.amountBalance =null;
                                return;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                // mainDivVM.formSigning.amountBalance =null;
                                return;
                            } else {
                                callback();
                            }
                        }, trigger: 'change'
                    }
                ],
                makeUpTime: [
                    // {type: 'date',required: true, message: '请选择预计余款补齐时间', trigger: 'change'}
                    {required: true, message: '请选择预计余款补齐时间', trigger: 'change'}
                ],
                amountPerformance: [
                    {
                        required: true, validator: function (rule, value, callback) {
                            if (value == "0") {
                                callback();
                            }
                            var reg = /^\+?[1-9][0-9]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请输入业绩金额"));
                                return;
                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入整数"));
                                return;
                            } else {
                                callback();
                            }
                        }, trigger: 'blur'
                    }
                ],
                isRemoteSign: [ //是否远程签约
                    {required: true, message: '请选择是否远程签约', trigger: 'change'}
                ],
                visitTime: [ //请选择到访时间
                    {required: true, message: '请选择到访时间', trigger: 'change'}
                ],
                arrVisitCity: [ //请填写到访城市
                    {required: true, message: '请填写到访城市', trigger: 'blur'}
                ],
                visitType: [ //请选择到访类型
                    {required: true, message: '请选择到访类型', trigger: 'change'}
                ],
                visitShopType: [ //请选择到访店铺类型
                    {required: true, message: '请选择到访店铺类型', trigger: 'blur'}
                ],
                visitNum: [ //请填写到访人数
                    {required: true, message: '请填写到访人数', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请填写到访人数"));
                                mainDivVM.formSigning.visitNum = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.formSigning.visitNum = null;
                            } else {
                                callback();
                            }
                        }, trigger: 'blur'
                    }
                ],
                visitPeopleNum: [ //请填写到访人数
                    {required: true, message: '请填写到访人数', trigger: 'blur'},
                    {
                        validator: function (rule, value, callback) {
                            var reg = /^[0-9]+[0-9]*]*$/;
                            if (value == null || value == "null" || value == "") {
                                callback(new Error("请填写到访人数"));
                                mainDivVM.addVisitRecord.visitPeopleNum = null;

                            } else if (value != null && value != "null" && value != "" && !reg.test(value)) {
                                callback(new Error("请输入正整数"));
                                mainDivVM.addVisitRecord.visitPeopleNum = null;
                            } else {
                                callback();
                            }

                        }, trigger: 'change'
                    }
                ]
            },
            editRebutNoVisitRules:{
                notVisitReason: [
                    {required: true, message: '请输入未到访原因', trigger: 'blur'}
                ],
            }
        },
        methods: {
            handleClickSigning(tab, event) {
                console.log(tab, event);
                for(var i=0;i< this.responseData.paydetailList.length;i++) {
                    if (this.responseData.paydetailList[i].name === tab.name) {
                        // 付款类型判断
                        if (this.responseData.paydetailList[i].payType > 2) {
                            if (this.responseData.paydetailList[i].payType == 3) {
                                this.isAllMoney = true;
                            } else {
                                this.isAllMoney = false;
                            }
                            this.payTypeSelect = false;
                            this.payTypeArr = mainDivVM.payTypeArr1.slice(2, 4);
                            // 追加定金或者尾款时候，签约类型禁选
                            this.notEditRebutSign=true;
                        } else {
                            if (this.responseData.paydetailList[i].payType == 1) {
                                this.isAllMoney = false;
                            } else {
                                this.isAllMoney = true;
                            }
                            this.payTypeSelect = true;
                            this.payTypeArr = this.payTypeArr1.slice(0, 2);
                            // 全款或者定金时候，签约类型可选
                            this.notEditRebutSign=false;
                        }
                        this.updateFormSigning.payType=this.responseData.paydetailList[i].payType;//付款类型
                        this.updateFormSigning.payTime=this.responseData.paydetailList[i].payTime;//付款时间
                        //付款方式
                        var modeArr = this.responseData.paydetailList[i].payMode.split(",");
                        this.updateFormSigning.payModes = this.tansPayModeValueToName(modeArr);
                        this.updateFormSigning.amountReceived = this.responseData.paydetailList[i].amountReceived;//实收金额
                        this.updateFormSigning.amountEquipment = this.responseData.paydetailList[i].amountEquipment;//实收设备金额
                        this.updateFormSigning.amountPerformance = this.responseData.paydetailList[i].amountPerformance;//业绩金额
                        this.updateFormSigning.preferentialAmount = this.responseData.paydetailList[i].preferentialAmount;//招商政策金额
                        this.updateFormSigning.firstToll=this.responseData.paydetailList[i].firstToll;//路费
                        this.updateFormSigning.giveAmount = this.responseData.paydetailList[i].giveAmount;//赠送金额
                        // 赠送类型
                        if(this.responseData.paydetailList[i].giveType ==null || this.responseData.paydetailList[i].giveType =='-1'){
                            this.updateFormSigning.giveType = null;
                        }else{
                            this.updateFormSigning.giveType = this.responseData.paydetailList[i].giveType + "";
                        }
                        this.updateFormSigning.remarks = this.responseData.paydetailList[i].remarks;//备注
                        this.updateFormSigning.amountBalance = this.responseData.paydetailList[i].amountBalance;//余款金额
                        this.updateFormSigning.makeUpTime = this.responseData.paydetailList[i].makeUpTime;//预计余款补齐时间
                        // payDetailId赋值
                        this.updateFormSigning.payDetailId = this.responseData.paydetailList[i].id;
                        // visitDetailRecordId赋值
                        this.updateFormSigning.visitDetailRecordId = this.responseData.paydetailList[i].visitRecordId;
                    }
                }
                this.signTabIndex=parseInt(tab.index);
                this.suppUpdateShow(tab.index) // 点击tab切换到访记录关联
            },
            createClueData(){
                window.location.href='/aggregation/businessMyCustomer/createClue';
            },
            clickRow(row){
                this.$refs.multipleTable.toggleRowSelection(row)
            },
            formSigningAmountPerformance() {
                var aone = parseFloat(this.formSigning.amountReceived);
                var atwo = parseFloat(this.formSigning.firstToll);
                var athree = parseFloat(this.formSigning.amountEquipment);
                if (isNaN(aone)) aone = 0
                if (isNaN(atwo)) atwo = 0
                if (isNaN(athree)) athree = 0
                this.formSigning.performanceAmount = (aone + atwo + athree) + ""
            },
            updateFormSigningAmountPerformance() {
                var aone = parseFloat(this.updateFormSigning.amountReceived);
                var atwo = parseFloat(this.updateFormSigning.firstToll);
                var athree = parseFloat(this.updateFormSigning.amountEquipment);
                if (isNaN(aone)) aone = 0
                if (isNaN(atwo)) atwo = 0
                if (isNaN(athree)) athree = 0    
                this.updateFormSigning.amountPerformance = (aone + atwo +athree) + ""
            },
            tabClick(tab, event) {
                this.updateFormSigning = this.editableTabs[tab.index].updateFormSigning;
            },
            formatVisitTime(row) {
                function dateFtt(fmt, date) { //author: meizz
                    var o = {
                        "M+": date.getMonth() + 1,                 //月份
                        "d+": date.getDate(),                    //日
                        "h+": date.getHours(),                   //小时
                        "m+": date.getMinutes(),                 //分
                        "s+": date.getSeconds(),                 //秒
                        "q+": Math.floor((date.getMonth() + 3) / 3), //季度
                        "S": date.getMilliseconds()             //毫秒
                    };
                    if (/(y+)/.test(fmt))
                        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
                    for (var k in o)
                        if (new RegExp("(" + k + ")").test(fmt))
                            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
                    return fmt;
                }

                return dateFtt("yyyy-MM-dd hh:mm", new Date(row.vistitTime));
            },
            formatVisit(row, column) {
                if (row.visitStatus == 0) {
                    resVal = '未到访（原因）';
                } else if (row.visitStatus > 0 && row.visitAuditStatus == 1) {
                    resVal = '审核中';
                } else if (row.visitStatus > 0 && row.visitAuditStatus == 0) {
                    resVal = '到访被驳回';
                } else if (row.visitStatus > 0 && row.visitAuditStatus == 2) {
                    resVal = '查看到访记录';
                } else {
                    //没有状态的时候
                    resVal = '添加到访记录';
                }
                return resVal;
            },

            formatVisitStatus(row, column) {
                var resVal = '待处理';
                if (row.visitStatus == 0) {
                    resVal = '未到访';
                } else if (row.visitStatus == 1) {
                    resVal = '已到访';
                    var visitNum = row.auditVisitNum;
                    if(visitNum == 1){
                        resVal = '首次到访';
                    }else if(visitNum == 2){
                        resVal = '2次到访';
                    }else if(visitNum == 3){
                        resVal = '3次到访';
                    } else if(visitNum == 4){
                        resVal = '4次到访';
                    }else if(visitNum == 5){
                        resVal = '5次到访';
                    }
                }
                return resVal;
            },
            formatSignStatus(row, column) {
                var resVal = '未签约';
                if (row.isSign == 1) {
                    resVal = '已签约';
                } else if (row.isSign == 2) {
                    resVal = "已退款";
                }

                return resVal;
            },
            //是否有邀请函
            transformLetter(row, column, cellValue, index) {
                var text="";
                if(cellValue == "0"){
                    text="否"
                }else if(cellValue == "1"){
                    text="是"
                }
                return text;
            },
            setAddPerformanceAmount(value) {
                this.formSigning.performanceAmount = this.formSigning.amountReceived
            },
            setUpdatePerformanceAmount(value) {
                this.updateFormSigning.performanceAmount = this.updateFormSigning.amountReceived
            },
            handleSelectionChange(val) {
                this.multipleSelection = val;
            },
            selectIsRemoteSign(pa1) { //是否远程签约event
                // if (pa1 == 1) {//1是远程签约
                //     this.suppWrap = false;
                // } else {
                //     this.suppWrap = true;
                // }
                if (pa1 == 1) {//1是远程签约
                    this.isshowVisit = false;
                    //清空补充到访记录数据
                    this.formSigning.arrVisitCity = '';
                    this.formSigning.visitNum = '';
                    this.formSigning.visitShopType = '';
                    this.formSigning.visitTime = new Date();;
                    this.formSigning.visitType = 1;
                } else {
                    this.busVisitEcho();
                    this.isshowVisit = true;
                }
            },
            updateSelectIsRemoteSign(pa1) { //是否远程签约event
                // if (pa1 == 1) {//1是远程签约
                //     this.suppWrap = false;
                // } else {
                //     this.suppWrap = true;
                // }
                if (pa1 == 1) {//1是远程签约
                    this.updateIsshowVisit = false;
                    //清空补充到访记录数据
                    this.updateFormSigning.arrVisitCity = '';
                    this.updateFormSigning.visitNum = '';
                    this.updateFormSigning.visitShopType = '';
                    this.updateFormSigning.visitTime = new Date();;
                    this.updateFormSigning.visitType = 1;
                } else {
                    this.updateIsshowVisit = true;
                }
            },
            suppShow() { //补充到访记录展开
                this.suppWrap = true;
                this.shouAddVisitButton = false;
                busVisitEcho();
            },

            busVisitEcho(){
                var param = {};
                param.id = mainDivVM.formSigning.clueId;
                axios.post('/businesssign/visitEcho', param).then(function (response) {
                    var echoData = response.data.data;
                    if(echoData.arrVisitCity){
                        mainDivVM.formSigning.arrVisitCity = echoData.arrVisitCity;
                    }
                    if (echoData.visitNum > 0) {
                        mainDivVM.formSigning.visitNum = echoData.visitNum;
                    }

                    if(echoData.visitShopType){
                        mainDivVM.formSigning.visitShopType = ""+response.data.data.visitShopType;
                    }

                    mainDivVM.formSigning.visitType = 1;

                    mainDivVM.formSigning.visitTime = new Date();
                });
            },

            suppHide() {
                this.suppWrap = false;
                this.shouAddVisitButton = true;
                //清空补充到访记录数据
                if(this.formSigning.arrVisitCity){
                    this.formSigning.arrVisitCity = '';
                }
                if(this.formSigning.visitNum){
                    this.formSigning.visitNum = '';
                }

                if(this.formSigning.visitShopType){
                    this.formSigning.visitShopType = '';
                }
                if(  this.formSigning.visitTime ){
                    this.formSigning.visitTime = '';
                }
                if( this.formSigning.visitType){
                    this.formSigning.visitType = '';
                }

            },

            suppUpdateShow(index) { //补充到访记录展开
                this.suppWrap = true;
                this.shouAddVisitButton = false;
                index=this.signTabIndex;
                var param = {};
                console.log(mainDivVM.updateFormSigning.paydetailList[index].visitRecordId)
                if(!mainDivVM.updateFormSigning.paydetailList[index].visitRecordId){
                    //清空补充到访记录数据
                    this.updateFormSigning.arrVisitCity = '';
                    this.updateFormSigning.visitNum = '';
                    this.updateFormSigning.visitShopType = '';
                    this.updateFormSigning.visitTime = new Date();;
                    this.updateFormSigning.visitType = 1;
                    return false;
                }
                param.id = mainDivVM.updateFormSigning.paydetailList[index].visitRecordId;
                //TODO
                axios.post('/busVisitRecord/one', param).then(function (response) {
                    var echoData = response.data.data;
                    console.log("============================")
                    console.log(echoData)
                    if(echoData.arrVisitCity){
                        mainDivVM.updateFormSigning.arrVisitCity = echoData.arrVisitCity;
                    }
                    if (echoData.visitPeopleNum > 0) {
                        mainDivVM.updateFormSigning.visitNum = echoData.visitPeopleNum;
                    }
                    mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                    mainDivVM.updateFormSigning.visitShopType = echoData.vistitStoreType;
                    mainDivVM.updateFormSigning.visitType = echoData.visitType;
                    mainDivVM.updateFormSigning.visitTime =  echoData.vistitTime;
                });
            },
            suppUpdateHide() {
                this.suppWrap = false;
                this.shouAddVisitButton = true;
                //清空补充到访记录数据
                this.updateFormSigning.arrVisitCity = '';
                this.updateFormSigning.visitNum = '';
                this.updateFormSigning.visitShopType = '';
                this.updateFormSigning.visitTime = '';
                this.updateFormSigning.visitType = '';
            },


            changePayType(val) {
                if (val == 3) {
                    this.isAllMoney = true;
                } else {
                    this.isAllMoney = false;
                }
            },
            notVisit() {                
                this.resetForm("notVisitFlag")
                var rows = mainDivVM.multipleSelection;
                if (rows.length == 0) {
                    this.$message({message: '请选择数据', type: 'warning'});
                    return false;
                } else {
                    var names = "";
                    var rowIds = [];
                    for (var i = 0; i < rows.length; i++) {
                        // if(rows[i].visitStatus==0||rows[i].visitStatus==1||rows[i].visitStatus==2||rows[i].visitStatus==3){
                        //     this.$message({message: '勾选数据中，包含了已到访或是已标记的客户', type: 'warning'});
                        //     return false;
                        // }
                        names = names + '【' + rows[i].cusName + '】';
                        rowIds.push(rows[i].clueId);
                    }
                    var str = '请填写客户姓名' + names + '未到访的原因?';
                    this.notVisitFlag.clueIds = rowIds;
                    this.notVisitFlag.str = str;
                    this.notVisitFlag.notVisitReason = "";
                    this.notVisitFlag.notVisitUser="";
                    this.notVisitFlag.notVisitTime="";
                    this.notVisitFlagDialogVisible = true;
                    this.notVisitButtonAble = false;//允许提交按钮点击
                }
            },
            saveNotVisit() {
                var param = this.notVisitFlag;
                // 设置 clueid
                if (mainDivVM.notVisitButtonAble == true) {
                    return;
                }
                this.$refs['notVisitFlag'].validate((valid) => {
                    if (valid) {
                        mainDivVM.notVisitButtonAble = true;
                        axios.post("/aggregation/businessMyCustomer/notVisit", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '标记成功!', duration: 2000, onClose: function () {
                                            mainDivVM.pager.pageNum = 1
                                            mainDivVM.initList();
                                            mainDivVM.notVisitFlagDialogVisible = false;
                                            mainDivVM.addVisitRecord.clueId = "";
                                            // mainDivVM.notVisitButtonAble = false;//允许提交按钮点击
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                    mainDivVM.notVisitButtonAble = false;
                                }
                            }).catch(function (error) {
                            mainDivVM.notVisitButtonAble = false;
                            console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },
            showCustomerDetail(row, column) { // 客户详情改成编辑（客户维护）
                var clueId=row.clueId;
                // 存储选中信息--start
                this.setSessionStore("myCustomerListStoreForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("myCustomerListOtherVal", otherVal);
                // 存储选中信息--end

                // window.location.href = '/bus/BusinessCustomer/viewCustomerInfo?clueId=' + row.clueId;
                window.location.href = '/bus/BusinessCustomer/editCustomerInfo?clueId=' + clueId;
            },
            editCustomerDetail(row, column) { // 客户维护
                var clueId=row.clueId;
                // 存储选中信息--start
                this.setSessionStore("myCustomerListStoreForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("myCustomerListOtherVal", otherVal);
                // 存储选中信息--end

                window.location.href = '/bus/BusinessCustomer/editCustomerInfo?clueId=' + clueId;
            },
            currentProvince(selVal) {
                if (!selVal) {
                    return false;
                }
                param = {};
                param.type = "1";
                param.name = selVal;
                axios.post('/area/sysregion/querySysRegionByParam', param).then(function (response) {
                    mainDivVM.cityArr = response.data.data.data;
                });
            },
            currentCity(selVal) {
                if (!selVal) {
                    return false;
                }
                param = {};
                param.type = "2";
                param.name = selVal;
                axios.post('/area/sysregion/querySysRegionByParam', param).then(function (response) {
                    mainDivVM.districtArr = response.data.data.data;
                });
            },

            changeUpdateVisitProvince(selVal) {
                mainDivVM.updateVisitRecord.signCity = '';
                mainDivVM.updateVisitRecord.signDistrict = '';
                mainDivVM.districtArr = []
                this.currentProvince(selVal);
            },
            changeUpdateVisitCity(selVal) {
                mainDivVM.updateVisitRecord.signDistrict = '';
                this.currentCity(selVal);
            },
            changeVisitProvince(selVal) {
                mainDivVM.addVisitRecord.signCity = '';
                mainDivVM.addVisitRecord.signDistrict = '';
                mainDivVM.districtArr = []
                this.currentProvince(selVal);
            },
            changeVisitCity(selVal) {
                mainDivVM.addVisitRecord.signDistrict = ''
                this.currentCity(selVal);
            },

            changeUpdateSignProvince(selVal) {
                mainDivVM.updateFormSigning.signCity = '';
                mainDivVM.updateFormSigning.signDictrict = '';
                mainDivVM.districtArr = []
                this.currentProvince(selVal);
            },
            changeUpdateSignCity(selVal) {
                mainDivVM.updateFormSigning.signDictrict = '';
                this.currentCity(selVal);
            },
            changeSignProvince(selVal) {
                mainDivVM.formSigning.signCity = '';
                mainDivVM.formSigning.signDictrict = '';
                mainDivVM.districtArr = []
                this.currentProvince(selVal);
            },
            changeSignCity(selVal) {
                mainDivVM.formSigning.signDictrict = '';
                this.currentCity(selVal);
            },
            saveVisitRecord() {

                if(this.addVisitRecord.isSign==0&&!this.addVisitRecord.notSignReason){
                    mainDivVM.$message({
                        type: 'error', message: '请填写未签约原因！'});
                    return false;
                }

                if (mainDivVM.addVisitButtonAble == true) {
                    return false;
                }
                var param = this.addVisitRecord;
                param.rebutTime = new Date(param.rebutTime)
                param.createTime = new Date(param.createTime)
                // 设置 clueid
                this.$refs['addVisitRecord'].validate((valid) => {
                    if (valid) {
                        mainDivVM.addVisitButtonAble = true;
                        axios.post("/busVisitRecord/insert", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '来访记录提交成功!', duration: 2000, onClose: function () {
                                            mainDivVM.pager.pageNum = 1
                                            mainDivVM.initList();
                                            mainDivVM.addVisitRecordDialogVisible = false;
                                            mainDivVM.addVisitRecord.clueId = "";
                                            // mainDivVM.addVisitButtonAble = false;//按钮允许点击
                                        }
                                    });
                                } else {
                                    mainDivVM.addVisitButtonAble = false;
                                    mainDivVM.$message.error(response.data.msg);
                                }
                            }).catch(function (error) {
                                mainDivVM.addVisitButtonAble = false;
                                console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },

            updateVisitRecordMethod() {
                if(this.updateVisitRecord.isSign==0&&!this.updateVisitRecord.notSignReason){
                    mainDivVM.$message({
                        type: 'error', message: '请填写未签约原因！'});
                    return false;
                }
                // 设置 clueid
                if (mainDivVM.updateVisitButtonAble == true) {
                    return false;
                }
                this.$refs['updateVisitRecord'].validate((valid) => {
                    if (valid) {
                        mainDivVM.updateVisitButtonAble = true;
                        var param = {};
                        param.id = this.updateVisitRecord.id;
                        param.clueId = this.updateVisitRecord.clueId;
                        param.companyid = this.updateVisitRecord.companyid;
                        param.vistitTime = new Date(this.updateVisitRecord.vistitTime);
                        param.customerName = this.updateVisitRecord.customerName;
                        param.projectId = this.updateVisitRecord.projectId;
                        param.visitType = this.updateVisitRecord.visitType;
                        param.vistitStoreType = this.updateVisitRecord.vistitStoreType;
                        param.signProvince = this.updateVisitRecord.signProvince;
                        param.signCity = this.updateVisitRecord.signCity;
                        param.signDistrict = this.updateVisitRecord.signDistrict;
                        param.arrVisitCity = this.updateVisitRecord.arrVisitCity;
                        param.isSign = this.updateVisitRecord.isSign;
                        param.visitPeopleNum = this.updateVisitRecord.visitPeopleNum;
                        if (param.isSign == 1) { // 已签约
                            param.notSignReason = "";
                        } else {
                            param.notSignReason = this.updateVisitRecord.notSignReason;
                        }
                        param.notSignReason = this.updateVisitRecord.notSignReason;
                        if (param.rebutTime) {
                            param.rebutTime = new Date(param.rebutTime)
                        }
                        if (param.vistitTime) {
                            param.vistitTime = new Date(param.vistitTime)
                        }

                        axios.post("/busVisitRecord/update", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '来访提交成功!', duration: 2000, onClose: function () {
                                            mainDivVM.pager.pageNum = 1
                                            mainDivVM.initList();
                                            mainDivVM.updateVisitRecordDialogVisible = false;
                                            mainDivVM.updateVisitRecord.clueId = "";
                                            mainDivVM.updateVisitRecord.id = "";
                                            // mainDivVM.updateVisitButtonAble = false;//允许按钮点击
                                        }
                                    });
                                } else {
                                    mainDivVM.updateVisitButtonAble = false;
                                    mainDivVM.$message.error(response.data.msg);
                                }
                            }).catch(function (error) {
                            console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },

            showNotSignReason(val) {
                if (this.addVisitRecordDialogVisible) {
                    if (val == 1) {
                        this.addVisitRecord.notSignReason = '';
                    }
                } else {
                    if (val == 1) {
                        console.log(this.updateVisitRecord.notSignReason)
                        this.updateVisitRecord.notSignReason = '';
                    }
                }

                if (val == 0) {
                    //  将隐藏换成元素添加 和 移除 ，这样的动态就会变得好看
                    document.getElementById("notSignReason").setAttribute("style", "display:block")
                    document.getElementById("goSignButton").setAttribute("style", "visibility:hidden")
                    // document.getElementById("goSignButton").setAttribute("style","display:none")
                } else if (val == 1) {
                    document.getElementById("notSignReason").setAttribute("style", "display:none")
                    document.getElementById("goSignButton").setAttribute("style", "visibility:visible")
                    //   document.getElementById("goSignButton").setAttribute("style","display:block")
                }
            },
            openEditVisitRecord(row) {
                this.addVisitButtonAble = false;//提交按钮允许点击
                //关闭未到访原因弹窗
                this.notVisitdDialogVisible = false;
                // 打开编辑到访记录
                this.resetForm('addVisitRecord')
                var param = {};
                if (row.clueId) {
                    param.id = row.clueId;
                } else {
                    param.id = mainDivVM.notVisitFlag.clueId;
                    row.clueId = mainDivVM.notVisitFlag.clueId;
                }


                if (row.signAuditStatus == 0 || row.signAuditStatus == 1 || row.signAuditStatus == 2) {
                    mainDivVM.existsSign = true;
                    mainDivVM.curSignStatus = row.signAuditStatus;
                }

                axios.post('/busVisitRecord/echo', param).then(function (response) {
                    mainDivVM.addVisitRecord = response.data.data;
                    mainDivVM.addVisitRecord.clueId = row.clueId;
                    mainDivVM.addVisitRecord.vistitTime = new Date();
                    mainDivVM.addVisitRecordDialogVisible = true;
                    mainDivVM.currentProvince(mainDivVM.addVisitRecord.signProvince);
                    mainDivVM.currentCity(mainDivVM.addVisitRecord.signCity);
                    //mainDivVM.showNotSignReason(mainDivVM.addVisitRecord.isSign);
                    console.log("###"+response.data.data.vistitStoreTypeArr);
                    mainDivVM.vistitStoreTypeArr= response.data.data.vistitStoreTypeArr;
                });
            },
            getShopType(value,flag){
                var param = {};
                param.id = value;
                axios.post('/busVisitRecord/getShortTypeByProjectId', param).then(function (response) {
                    console.log("###"+response.data.data);
                   if(!flag){
                       if(mainDivVM.addVisitRecord.vistitStoreType){
                           mainDivVM.addVisitRecord.vistitStoreType ='';
                       }
                       if(mainDivVM.updateVisitRecord.vistitStoreType){
                           mainDivVM.updateVisitRecord.vistitStoreType ='';
                       }
                       if(mainDivVM.formSigning.signShopType){
                           mainDivVM.formSigning.signShopType ='';
                       }
                       if(mainDivVM.formSigning.visitShopType){
                           mainDivVM.formSigning.visitShopType ='';
                       }
                       if(mainDivVM.updateFormSigning.signShopType){
                           mainDivVM.updateFormSigning.signShopType ='';
                       }
                       if(mainDivVM.updateFormSigning.visitShopType){
                           mainDivVM.updateFormSigning.visitShopType ='';
                       }
                   }
                    mainDivVM.vistitStoreTypeArr= response.data.data;
                    mainDivVM.signStoreTypeArr= response.data.data;
                });
            },
            getShopTypeEdit(value,flag){

                var param = {};
                param.id = value;
                axios.post('/busVisitRecord/getShortTypeByProjectId', param).then(function (response) {
                    console.log("###"+response.data.data);
                    mainDivVM.signStoreTypeArr= response.data.data;
                    if(mainDivVM.updateFormSigning.signShopType){
                        if(!flag){
                            mainDivVM.updateFormSigning.signShopType ='';
                        }
                    }
                    if(!mainDivVM.updateFormSigning.visitDetailRecordId){
                        if(!flag){
                            mainDivVM.updateFormSigning.visitShopType ='';
                        }
                        mainDivVM.vistitStoreTypeArr= response.data.data;
                    }
                });
            },
            getVisitShopTypeEdit(value){
                var param = {};
                param.id = value;
                axios.post('/busVisitRecord/getShortTypeByProjectId', param).then(function (response) {
                    console.log("###"+response.data.data);
                    mainDivVM.vistitStoreTypeArr= response.data.data;
                    if(mainDivVM.updateFormSigning.visitShopType){
                        mainDivVM.updateFormSigning.visitShopType ='';
                    }
                });
            },
            showNotVisitReason(row) {
                var param = {};
                param.id = row.visitId;
                mainDivVM.notVisitFlag.clueId = row.clueId;
                axios.post('/busVisitRecord/one', param).then(function (response) {
                    mainDivVM.notVisitdDialogVisible = true;
                    console.log(response.data.data);
                    mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                    mainDivVM.notVisitFlag.str = response.data.data.notVisitReason
                    mainDivVM.notVisitFlag.createUserName = response.data.data.createUserName
                    mainDivVM.notVisitFlag.notVisitTime = response.data.data.createTime
                });
            },
            showNotVisitReason1(row) {
                var param = {};
                param.id = row.visitId;
                mainDivVM.notVisitFlag.clueId = row.clueId;
                axios.post('/busVisitRecord/one', param).then(function (response) {
                    mainDivVM.notVisitdDialogVisible1 = true;
                    mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                    mainDivVM.notVisitFlag.str = response.data.data.notVisitReason
                    mainDivVM.notVisitFlag.createUserName = response.data.data.createUserName
                    mainDivVM.notVisitFlag.notVisitTime = response.data.data.createTime
                });
            },
            //查看驳回未到访
            rejectNotVisit(row){
                this.editRebutNoVisitDialog = true;
                var param = {};
                param.id = row.id
                axios.post('/busVisitRecord/one', param).then(function (response) {
                    if (null === response || response.data == null || response.data.code != '0') {
                        if (response.data.code != '0') {
                            mainDivVM.$message({message: response.data.msg, type: 'warning'});
                        }
                        return false;
                    } else {
                        mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                        mainDivVM.editRebutNoVisit.id = response.data.data.id;
                        mainDivVM.editRebutNoVisit.rejectTime = response.data.data.rebutTime;
                        mainDivVM.editRebutNoVisit.rejectUser = response.data.data.auditPersonName;
                        mainDivVM.editRebutNoVisit.rejectReason = response.data.data.rebutReason;
                        mainDivVM.editRebutNoVisit.notVisitTime = response.data.data.createTime;
                        mainDivVM.editRebutNoVisit.notVisitReason = response.data.data.notVisitReason;
                    }

                })
            },
            //编辑驳回未到访
            updateRejectNotVisit(formName) {
                var notVisitReason = mainDivVM.editRebutNoVisit.notVisitReason;
                var param = {};
                param.id = mainDivVM.editRebutNoVisit.id;
                param.notVisitReason = notVisitReason;
                this.$refs[formName].validate((valid) => {
                    if (mainDivVM.updateRejectNotVisitButtonAble == true) {
                        return false;
                    }
                    if (valid) {
                        mainDivVM.updateRejectNotVisitButtonAble = true;
                        axios.post("/busVisitRecord/update", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '未到访原因更新成功!', duration: 1000, onClose: function () {
                                            mainDivVM.editRebutNoVisitDialog = false;
                                            mainDivVM.initList();
                                            mainDivVM.updateRejectNotVisitButtonAble = false;
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                    mainDivVM.updateRejectNotVisitButtonAble = false;
                                }
                            }).catch(function (error) {
                            mainDivVM.updateRejectNotVisitButtonAble = false;
                            console.log(error);
                        });
                    } else {
                        return false;
                    }
                });

            },
            //关闭编辑驳回未到访
            closeEditRebutNoVisitDialog(){
                // 隐藏
                this.editRebutNoVisitDialog = false;
                this.resetForm("editRebutNoVisit")
            },
            showVisitRecord(row) {
                // 展示到访记录
                this.showVisitAduitDialogVisible = true;
                var param = {};
                param.clueId = row.clueId
                axios.post('/busVisitRecord/queryList', param).then(function (response) {
                    if (null === response || response.data == null || response.data.code != '0') {
                        if (response.data.code != '0') {
                            mainDivVM.$message({message: response.data.msg, type: 'warning'});
                        }
                        return false;
                    } else {
                        //mainDivVM.showVisitAduitDatas.visitTableData =response.data.data;
                        // mainDivVM.showVisitAduitDatas.visitStatus = row.visitStatus
                        // if(response.data.data.length>0){
                        //     mainDivVM.showVisitAduitDatas.notSignReason = response.data.data[0].notSignReason
                        // }
                        var dataList = response.data.data;
                        mainDivVM.setVisitRecordData(dataList);
                        //
                    }

                })
            },

            toVisitRecordPage(row) {
                var clueId=row.clueId;
                // 存储选中信息--start
                this.setSessionStore("myCustomerListStoreForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("myCustomerListOtherVal", otherVal);
                // 存储选中信息--end
                var vbusGroupId ;
                if(row.businessGroupId){
                    vbusGroupId = row.businessGroupId;
                }else{
                    vbusGroupId =row.busGroupId;
                }
                window.location.href = '/busVisitRecord/visitRecordPage?busGroupId='+vbusGroupId+'&clueId=' + clueId + "&visitStatus=" + row.visitStatus + "&signAuditStatus=" + row.signAuditStatus;
            },
            handleClick(tab, event) {
                console.log(tab)
                if (tab.label == '未到访记录') {
                    this.showTabNotVisitData = true;
                    mainDivVM.notVisitData = mainDivVM.hisDatas[tab.name];
                } else {
                    this.showTabNotVisitData = false;
                    mainDivVM.setVisitRecordData(mainDivVM.hisDatas[tab.name]);
                }
            },
            showHistory(row) {
                var param = {};
                mainDivVM.editableTabs = [];
                this.showHisVisitRecordDialog = true;
                this.activeName = "0"; // 通过名称设置默认显示
                param.clueId = row.clueId
                param.busGroupId = row.busGroupId
                axios.post('/busVisitRecord/queryHisList', param).then(function (response) {
                    // 动态生成tab
                    var tabs = [];
                    for (var i = 0; i < response.data.length; i++) {
                        var tab = {};
                        if (response.data[i][0]) {
                            if (response.data[i][0].isVisit == 0) {
                                tab.title = "未到访记录";
                            } else {
                                tab.title = response.data[i][0].createUserName + "-客户到访记录";
                            }
                            tab.name = "" + i;
                            tabs.push(tab)
                        }
                    }
                    mainDivVM.editableTabs = tabs;
                    mainDivVM.hisDatas = response.data;

                    if (mainDivVM.hisDatas[0][0]) {
                        if (response.data[0][0].isVisit == 0) {
                            mainDivVM.notVisitData = mainDivVM.hisDatas[0];
                            mainDivVM.showTabNotVisitData = true;
                        } else {
                            mainDivVM.setVisitRecordData(mainDivVM.hisDatas[0]);
                            mainDivVM.showTabNotVisitData = false;
                        }
                    }
                });
            },
            setVisitRecordData(dataList) {

                // 首次到访
                var first = [];
                if (dataList.length >= 1) {
                    first.push(dataList[dataList.length - 1])
                    mainDivVM.showVisitAduitDatas.one = first;
                    if (first[0].isSign == 0) {
                        mainDivVM.showVisitAduitDatas.oneNotSignReason = first[0].notSignReason;
                        mainDivVM.showVisitAduitDatas.oneNotSignShow = true;
                    }
                    if (first[0].rebutReason) {
                        mainDivVM.showVisitAduitDatas.oneRebutReason = first[0].rebutReason;
                        mainDivVM.showVisitAduitDatas.oneRebutShow = true;
                    }
                } else {
                    mainDivVM.showVisitAduitDatas.one = first;
                }
                // 二次到访
                var two = [];
                if (dataList.length >= 2) {
                    two.push(dataList[dataList.length - 2])
                    mainDivVM.showVisitAduitDatas.two = two;
                    mainDivVM.showVisitAduitDatas.twoShow = true;
                    if (two[0].isSign == 0) {
                        mainDivVM.showVisitAduitDatas.twoNotSignReason = two[0].notSignReason;
                        mainDivVM.showVisitAduitDatas.twoNotSignShow = true;
                    }
                    if (two[0].rebutReason) {
                        mainDivVM.showVisitAduitDatas.twoRebutReason = two[0].rebutReason;
                        mainDivVM.showVisitAduitDatas.twoRebutShow = true;
                    }
                } else {
                    mainDivVM.showVisitAduitDatas.two = two;
                    mainDivVM.showVisitAduitDatas.twoShow = false;
                }
                // 多次到访
                var three = []
                if (dataList.length >= 3) {
                    three = dataList.slice(0, dataList.length - 2)
                    mainDivVM.showVisitAduitDatas.three = three;
                    mainDivVM.showVisitAduitDatas.threeShow = true;
                    if (three[0].isSign == 0) {
                        mainDivVM.showVisitAduitDatas.threeNotSignReason = three[0].notSignReason;
                        mainDivVM.showVisitAduitDatas.threeNotSignShow = true;
                    }
                    if (three[0].rebutReason) {
                        mainDivVM.showVisitAduitDatas.threeRebutReason = three[0].rebutReason;
                        mainDivVM.showVisitAduitDatas.threeRebutShow = true;
                    }
                } else {
                    mainDivVM.showVisitAduitDatas.three = three;
                    mainDivVM.showVisitAduitDatas.threeShow = false;
                }
            },
            editRebutVisitRecord(row) {
                this.updateVisitButtonAble = false;// 允许提交按钮点击
                this.resetForm("updateVisitRecord");
                var param = {};
                console.log(row)
                param.id = row.visitId
                if (row.signAuditStatus == 0 || row.signAuditStatus == 1 || row.signAuditStatus == 2) {
                    mainDivVM.existsSign = true;
                    mainDivVM.curSignStatus = row.signAuditStatus;
                }
                axios.post('/busVisitRecord/one', param).then(function (response) {
                    console.log(response)
                    if (null === response || response.data == null || response.data.code != '0') {
                        if (response.data.code != '0') {
                            mainDivVM.$message({message: response.data.msg, type: 'warning'});
                        }
                        return false;
                    } else {
                        mainDivVM.updateVisitRecord = response.data.data;
                        mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                        mainDivVM.updateVisitRecord.clueId = row.clueId;
                        mainDivVM.updateVisitRecord.id = row.visitId
                        mainDivVM.updateVisitRecordDialogVisible = true;
                        mainDivVM.showNotSignReason(mainDivVM.updateVisitRecord.isSign);
                        mainDivVM.currentProvince(mainDivVM.updateVisitRecord.signProvince)
                        mainDivVM.currentCity(mainDivVM.updateVisitRecord.signCity)

                    }
                })
            },
            goEditSign() {
                if (!mainDivVM.existsSignMessage()) {
                    return false;
                }
                this.resetForm('formSigning')
                var param = this.addVisitRecord;
                param.rebutTime = new Date(param.rebutTime)
                param.createTime = new Date(param.createTime)
                this.$refs['addVisitRecord'].validate((valid) => {
                    if (valid) {
                        axios.post("/busVisitRecord/insert", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '来访记录提交成功!', duration: 2000, onClose: function () {
                                            mainDivVM.initList();
                                            mainDivVM.updateVisitRecordDialogVisible = false;
                                            mainDivVM.addVisitRecordDialogVisible = false;
                                            //  弹出签约单添加弹窗
                                            // mainDivVM.formSigning.clueId = mainDivVM.addVisitRecord.clueId;
                                            // mainDivVM.dialogFormSigningVisible = true;
                                            mainDivVM.toSign(mainDivVM.addVisitRecord)
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                }
                            }).catch(function (error) {
                            console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },

            toSign(val) {
                if (mainDivVM.curSignStatus == 0 && mainDivVM.curSignStatus !== "") { // 当前签约单的状态 == 0 存在驳回签约单。
                    mainDivVM.editRebutSign(val)
                } else {
                    mainDivVM.editSign(val)
                }
            },
            goUpdateEditSign() {
                if (!mainDivVM.existsSignMessage()) {
                    return false;
                }
                // 设置 clueid
                this.$refs['updateVisitRecord'].validate((valid) => {
                    if (valid) {
                        var param = {};
                        param.id = this.updateVisitRecord.id;
                        param.clueId = this.updateVisitRecord.clueId;
                        param.companyid = this.updateVisitRecord.companyid;
                        param.vistitTime = new Date(this.updateVisitRecord.vistitTime);
                        param.customerName = this.updateVisitRecord.customerName;
                        param.projectId = this.updateVisitRecord.projectId;
                        param.visitType = this.updateVisitRecord.visitType;
                        param.vistitStoreType = this.updateVisitRecord.vistitStoreType;
                        param.signProvince = this.updateVisitRecord.signProvince;
                        param.signCity = this.updateVisitRecord.signCity;
                        param.signDistrict = this.updateVisitRecord.signDistrict;
                        param.arrVisitCity = this.updateVisitRecord.arrVisitCity;
                        param.isSign = this.updateVisitRecord.isSign;
                        param.visitPeopleNum = this.updateVisitRecord.visitPeopleNum;
                        param.notSignReason = this.updateVisitRecord.notSignReason;
                        if (param.rebutTime) {
                            param.rebutTime = new Date(param.rebutTime)
                        }
                        if (param.createTimeTime) {
                            param.vistitTime = new Date(param.createTimeTime)
                        }

                        console.log(param)
                        axios.post("/busVisitRecord/update", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '来访提交成功!', duration: 2000, onClose: function () {
                                            mainDivVM.initList();
                                            mainDivVM.updateVisitRecordDialogVisible = false;
                                            //  弹出签约单添加弹窗
                                            // mainDivVM.formSigning.clueId = mainDivVM.addVisitRecord.clueId;
                                            // mainDivVM.dialogFormSigningVisible = true;
                                            // mainDivVM.editSign(mainDivVM.updateVisitRecord)
                                            mainDivVM.toSign(mainDivVM.updateVisitRecord)
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                }
                            }).catch(function (error) {
                            console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },
            existsSignMessage() {
                if (this.existsSign) {
                    if (this.curSignStatus == 0) {
                        mainDivVM.$message.error("存在被驳回签约单");
                    } else if (this.curSignStatus == 1) {
                        mainDivVM.$message.error("签约单正在审核中");
                    } else if (this.curSignStatus == 2) {
                        mainDivVM.$message.error("签约单已经存在");
                    }
                }
                if (this.curSignStatus == 0) {
                    return true;
                }
                return false;
            },
            editSign(row) {
                // this.formSigning.clueId=row.clueId;
                // this.dialogFormSigningVisible = true;
                this.resetForm('formSigning')
                this.isAllMoney = false;
                this.suppWrap = true;
                this.shouAddVisitButton = false;
                //ainDivVM.formSigning.payModes = [];
                var param = {};
                param.id = row.clueId;
                axios.post('/businesssign/echo', param).then(function (response) {
                    mainDivVM.formSigning = response.data.data;
                    mainDivVM.formSigning.clueId = row.clueId;
                    mainDivVM.dialogFormSigningVisible = true;
                    mainDivVM.currentProvince(mainDivVM.formSigning.signProvince)
                    mainDivVM.currentCity(mainDivVM.formSigning.signCity)
                    mainDivVM.getShopType(mainDivVM.formSigning.signProjectId,1)
                    mainDivVM.formSigning.payName = response.data.data.customerName;
                    mainDivVM.signStoreTypeArr = response.data.data.vistitStoreTypeArr;
                    mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                    if(response.data.data.visitShopType){
                        mainDivVM.formSigning.visitShopType = ""+response.data.data.visitShopType;
                    }
                });
            },
            showSignDetail(row) {

            },
            editRebutSign(row) {
                this.resetForm("updateFormSigning");
                var param = {};
                // console.log(row)
                param.id = row.signId
                param.signId = row.signId
                param.clueId = row.clueId
                axios.post('/businesssign/one', param).then(function (response) {
                    console.log(response)
                    if (null === response || response.data == null || response.data.code != '0') {
                        if (response.data.code != '0') {
                            mainDivVM.$message({message: response.data.msg, type: 'warning'});
                        }
                        return false;
                    } else {
                        //设置显示数据
                        var responseData=response.data.data
                        if(!responseData.amountBalance){//余款金额
                            responseData.amountBalance=""
                        }
                        if(!responseData.makeUpTime){//预计余款补齐时间
                            responseData.makeUpTime=""
                        }
                        mainDivVM.signStoreTypeArr = response.data.data.vistitStoreTypeArr;
                        //mainDivVM.vistitStoreTypeArr = response.data.data.vistitStoreTypeArr;
                        mainDivVM.updateFormSigning = responseData;
                        mainDivVM.responseData=responseData;
                        mainDivVM.dialogUpdateFormSigningVisible = true;//打开弹窗

                        mainDivVM.signTitle="编辑驳回签约单(签约单编号"+responseData.signNo+")"

                        if(responseData.payName == null || responseData.payName == ''){//付款人姓名
                            mainDivVM.updateFormSigning.payName=mainDivVM.updateFormSigning.customerName;
                        }
                        
                        mainDivVM.currentProvince(responseData.signProvince)
                        mainDivVM.currentCity(responseData.signCity)
                       // mainDivVM.getShopType(responseData.signProjectId,1)

                        // 判断是否远程签约
                        if(responseData.isRemoteSign&&responseData.isRemoteSign==1){//1是远程签约，不显示到访记录
                            mainDivVM.updateIsshowVisit=false;
                        }else{
                            mainDivVM.updateIsshowVisit=true;
                        }

                        // 默认显示tab1
                        if(responseData.paydetailList){
                            // 显示tab名称
                            for(var i=0;i<responseData.paydetailList.length;i++){
                                if(responseData.paydetailList[i].payType=="1"){
                                    responseData.paydetailList[i].label="全款"                                    
                                }else if(responseData.paydetailList[i].payType=="2"){
                                    responseData.paydetailList[i].label="定金"
                                }else if(responseData.paydetailList[i].payType=="3"){
                                    responseData.paydetailList[i].label="追加定金"
                                }else if(responseData.paydetailList[i].payType=="4"){
                                    responseData.paydetailList[i].label="尾款"
                                }  
                                responseData.paydetailList[i].name=i+"";//给tab赋值name
                                mainDivVM.activeNameSigning=responseData.paydetailList[0].name; //默认显示第一个tab                      
                            }
                            
                            // 付款类型判断
                            if (responseData.paydetailList[0].payType > 2) {
                                if (responseData.paydetailList[0].payType == 3) {
                                    mainDivVM.isAllMoney = true;
                                } else {
                                    mainDivVM.isAllMoney = false;
                                }
                                mainDivVM.payTypeSelect = false;
                                mainDivVM.payTypeArr = mainDivVM.payTypeArr1.slice(2, 4);
                                // 追加定金或者尾款时候，签约类型禁选
                                mainDivVM.notEditRebutSign=true;
                            } else {
                                if (responseData.paydetailList[0].payType == 1) {
                                    mainDivVM.isAllMoney = false;
                                } else {
                                    mainDivVM.isAllMoney = true;
                                }
                                mainDivVM.payTypeSelect = true;
                                mainDivVM.payTypeArr = mainDivVM.payTypeArr1.slice(0, 2);
                                // 全款或者定金时候，签约类型可选
                                mainDivVM.notEditRebutSign=false;
                            }
                            mainDivVM.updateFormSigning.payType=responseData.paydetailList[0].payType;//付款类型
                            mainDivVM.updateFormSigning.payTime=responseData.paydetailList[0].payTime;//付款时间
                            //付款方式
                            var modeArr = responseData.paydetailList[0].payMode.split(",");
                            mainDivVM.updateFormSigning.payModes = mainDivVM.tansPayModeValueToName(modeArr);
                            mainDivVM.updateFormSigning.amountReceived=responseData.paydetailList[0].amountReceived;//实收金额
                            mainDivVM.updateFormSigning.amountEquipment=responseData.paydetailList[0].amountEquipment;//实收设备金额
                            mainDivVM.updateFormSigning.amountPerformance=responseData.paydetailList[0].amountPerformance;//业绩金额
                            mainDivVM.updateFormSigning.preferentialAmount=responseData.paydetailList[0].preferentialAmount;//招商政策金额
                            mainDivVM.updateFormSigning.firstToll=responseData.paydetailList[0].firstToll;//路费
                            mainDivVM.updateFormSigning.giveAmount = responseData.paydetailList[0].giveAmount;//赠送金额
                            // 赠送类型
                            mainDivVM.updateFormSigning.giveType = responseData.paydetailList[0].giveType + "";
                            if(responseData.paydetailList[0].giveType ==null || responseData.paydetailList[0].giveType =='-1'){
                                mainDivVM.updateFormSigning.giveType = null;
                            }else{
                                mainDivVM.updateFormSigning.giveType = responseData.paydetailList[0].giveType + "";
                            }
                            mainDivVM.updateFormSigning.remarks = responseData.paydetailList[0].remarks;//备注
                            mainDivVM.updateFormSigning.amountBalance = responseData.paydetailList[0].amountBalance;//余款金额
                            mainDivVM.updateFormSigning.makeUpTime = responseData.paydetailList[0].makeUpTime;//预计余款补齐时间
                            // payDetailId赋值
                            mainDivVM.updateFormSigning.payDetailId = mainDivVM.responseData.paydetailList[0].id;
                            // visitDetailRecordId赋值
                            mainDivVM.updateFormSigning.visitDetailRecordId = mainDivVM.responseData.paydetailList[0].visitRecordId;

                            mainDivVM.signTabIndex=0;//点击编辑签约单tab的index为0
                            if(!mainDivVM.updateFormSigning.paydetailList[0].visitRecordId){
                                //清空补充到访记录数据
                                mainDivVM.updateFormSigning.arrVisitCity = '';
                                mainDivVM.updateFormSigning.visitNum = '';
                                mainDivVM.updateFormSigning.visitShopType = '';
                                mainDivVM.updateFormSigning.visitTime = new Date();
                                mainDivVM.updateFormSigning.visitType = 1;
                                mainDivVM.getShopTypeEdit(mainDivVM.updateFormSigning.signProjectId,1)
                                return false;
                            }
                            // mainDivVM.suppUpdateHide() // 默认隐藏 到访记录关联
                            mainDivVM.suppUpdateShow() // 默认展示第一个 到访记录关联 
                        } 
                    }
                })
            },
            toSignPage(row) {  // 进入签约单明细  能够 新增付款
                var clueId=row.clueId;
                // 存储选中信息--start
                this.setSessionStore("myCustomerListStoreForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("myCustomerListOtherVal", otherVal);
                // 存储选中信息--end
                window.location.href = '/businesssign/visitRecordPage?clueId=' + clueId + "&signId=" + row.signId + "&readyOnly=0"+"&type=0";
            },
            toReadOnlySignPage(row) {  // 进入签约单明细  能够 新增付款
                var clueId=row.clueId;
                // 存储选中信息--start
                this.setSessionStore("myCustomerListStoreForm", this.storeForm);
                var otherVal = {
                    "currentPage": this.pager.currentPage,
                    "clueId": clueId,
                    "scrollTop": this.$el.querySelector('.el-table__body-wrapper').scrollTop
                }
                this.setSessionStore("myCustomerListOtherVal", otherVal);
                // 存储选中信息--end
                window.location.href = '/businesssign/visitRecordPage?clueId=' + clueId + "&signId=" + row.signId + "&readyOnly=1&type=0";
            },
            selectSigningType(pa1) { //是不是全款
                // this.formSigning.amountBalance = null;
                // this.formSigning.makeUpTime = '';
                if (pa1 == '1') {
                    this.formSigning.payType = '1';
                    this.isAllMoney = false;
                } else {
                    this.formSigning.payType = '2';
                    this.isAllMoney = true;
                }
            },
            selectUpdateSigningType(pa1) { //是不是全款
                // this.updateFormSigning.amountBalance = '';
                // this.updateFormSigning.makeUpTime = '';
                if (pa1 == '1') {
                    this.updateFormSigning.payType = '1';
                    this.isAllMoney = false;
                } else {
                    this.updateFormSigning.payType = '2';
                    this.isAllMoney = true;
                }
            },

            tansPayModeNameToValue(payModes){
                var payModeArr = [];
                for(var i = 0 ; i < payModes.length;i++){
                    for(var j = 0 ; j < mainDivVM.option3s.length ; j++){
                        if(payModes[i]== mainDivVM.option3s[j].name){
                            payModeArr.push( mainDivVM.option3s[j].value);
                        }
                    }
                }
                return payModeArr.join(",");
            },

            tansPayModeValueToName(payModes){
                var payModeArr = [];
                for(var i = 0 ; i < payModes.length;i++){
                    for(var j = 0 ; j < mainDivVM.option3s.length ; j++){
                        if(payModes[i]== mainDivVM.option3s[j].value){
                            payModeArr.push( mainDivVM.option3s[j].name);
                        }
                    }
                }
                return payModeArr;
            },

            submitForm(formName) {

                if(this.formSigning.visitTime){
                    this.formSigning.visitTime = new Date(this.formSigning.visitTime);
                }
                if(this.formSigning.payTime){
                   this.formSigning.payTime = new Date(this.formSigning.payTime);
                }

                this.formSigning.amountPerformance = this.formSigning.performanceAmount;
                this.formSigning.payMode = mainDivVM.tansPayModeNameToValue(this.formSigning.payModes);
                var param = this.formSigning;
                // 设置 clueid
                this.$refs[formName].validate((valid) => {
                    if (mainDivVM.addSignButtonAble == true) {
                        return;
                    }
                    if (valid) {
                        mainDivVM.addSignButtonAble = true;
                        axios.post("/businesssign/insert", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '签约单提交成功!', duration: 2000, onClose: function () {
                                            mainDivVM.pager.pageNum = 1
                                            mainDivVM.initList();
                                            mainDivVM.dialogFormSigningVisible = false;
                                            mainDivVM.formSigning.clueId = "";
                                            mainDivVM.addSignButtonAble = false;
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                    mainDivVM.addSignButtonAble = false;
                                }
                            }).catch(function (error) {
                            console.log(error);
                            mainDivVM.addSignButtonAble = false;
                        });
                    } else {
                        return false;
                    }
                });
            },

            submitUpdateForm(formName) {
                // this.updateFormSigning.amountPerformance = this.updateFormSigning.performanceAmount;
                var param = this.updateFormSigning;
                if (param.makeUpTime) {
                    param.makeUpTime = new Date(param.makeUpTime)
                }
                if (param.payTime) {
                    param.payTime = new Date(param.payTime)
                }
                if(param.visitTime){
                    param.visitTime = new Date(param.visitTime);
                }
                this.updateFormSigning.payMode = mainDivVM.tansPayModeNameToValue(this.updateFormSigning.payModes);
                // 设置 clueid
                this.$refs[formName].validate((valid) => {
                    if (mainDivVM.updateSignButtonAble == true) {
                        return;
                    }
                    if (valid) {
                        mainDivVM.updateSignButtonAble = true;
                        axios.post("/businesssign/update", param)
                            .then(function (response) {
                                if (response.data.code == 0) {
                                    mainDivVM.$message({
                                        type: 'success', message: '签约单更新成功!', duration: 2000, onClose: function () {
                                            mainDivVM.pager.pageNum = 1
                                            mainDivVM.initList();
                                            mainDivVM.dialogUpdateFormSigningVisible = false;
                                            mainDivVM.updateSignButtonAble = false;
                                        }
                                    });
                                } else {
                                    mainDivVM.$message.error(response.data.msg);
                                    mainDivVM.updateSignButtonAble = false;
                                }
                            }).catch(function (error) {
                                mainDivVM.updateSignButtonAble = false;
                                console.log(error);
                        });
                    } else {
                        return false;
                    }
                });
            },

            resetForm(formName) {
                if (mainDivVM.$refs[formName]) {
                    mainDivVM.$refs[formName].resetFields();
                }
            },
            initList() {
                var param = this.queryForm;
                // param.pageSize = this.pager.pageSize;
                // param.pageNum = this.pager.currentPage;
                var pageSize = this.pager.pageSize;
                 var pageNum = this.pager.currentPage;
                 // 存储
                 localStorage.setItem('myCustomerListPageSize', pageSize);                 
                 param.pageNum=pageNum;
                 param.pageSize=pageSize;
                axios.post('/aggregation/businessMyCustomer/queryPage', param).then(function (response) {
                    if (null === response || response.data == null || response.data.code != '0') {
                        if (response.data.code != '0') {
                            mainDivVM.$message({message: response.data.msg, type: 'warning'});
                        }
                        return false;
                    } else {
                        mainDivVM.tableData = response.data.data.data;
                        mainDivVM.pager.currentPage = response.data.data.currentPage;
                        mainDivVM.pager.total = response.data.data.total;
                        mainDivVM.pager.pageSize = response.data.data.pageSize;
                        // console.log(mainDivVM.tableData)

                        // 取出存储的id
                         if(!mainDivVM.paginationShow){
                             if(mainDivVM.storeId){
                                 mainDivVM.$nextTick(function(){
                                    var storage = [];
                                    mainDivVM.tableData.forEach(function(item, index){
                                        if(item.clueId === mainDivVM.storeId ){
                                            storage.push(mainDivVM.tableData[index]);
                                        }
                                    })
                                    mainDivVM.toggleSelection(storage);
                                    mainDivVM.$el.querySelector('.el-table__body-wrapper').scrollTop = mainDivVM.scrollTop;
                                })
                            }
                         }else{
                            mainDivVM.removeSessionStore ("myCustomerListStoreForm");
                            mainDivVM.removeSessionStore ("myCustomerListOtherVal");
                         }
                        mainDivVM.paginationShow = true;
                        mainDivVM.storeForm = mainDivVM.queryForm;

                    }
                })
            },
            toggleSelection(rows) { // table select 默认选中fn
                if (rows) {
                    rows.forEach(row => {
                        this.$refs.multipleTable.toggleRowSelection(row,true);
                    });
                } else {
                    this.$refs.multipleTable.clearSelection();
                }
            },
            number() {//添加签约单余款
                this.formSigning.amountBalance = this.formSigning.amountBalance.replace(/[^\.\d]/g, '');
                this.formSigning.amountBalance = this.formSigning.amountBalance.replace('.', '');
            },
            number2() {//编辑签约单余款
                this.updateFormSigning.amountBalance = this.updateFormSigning.amountBalance.replace(/[^\.\d]/g, '');
                this.updateFormSigning.amountBalance = this.updateFormSigning.amountBalance.replace('.', '');
            },
            number3() {//添加签约单业绩金额
                this.formSigning.performanceAmount = this.formSigning.performanceAmount.replace(/[^\.\d]/g, '');
                this.formSigning.performanceAmount = this.formSigning.performanceAmount.replace('.', '');
            },
            number4() {//编辑签约单业绩金额
                this.updateFormSigning.amountPerformance = this.updateFormSigning.amountPerformance.replace(/[^\.\d]/g, '');
                this.updateFormSigning.amountPerformance = this.updateFormSigning.amountPerformance.replace('.', '');
            },
            toogleClick() {
                if (this.isShow) {
                    this.isShow = false
                } else {
                    this.isShow = true
                }
            },
            setSessionStore (name, content) {
                if (!name) return
                if (typeof content !== 'string') {
                content = JSON.stringify(content)
                }
                window.sessionStorage.setItem(name, content)
            },
            getSessionStore (name) {
                if (!name) return;
                var content = window.sessionStorage.getItem(name);
                if (typeof content == 'string') {
                    content = JSON.parse(content)
                }
                return content;
            },
            removeSessionStore (name) {
                if (!name) return
                return window.sessionStorage.removeItem(name)
            },
            projectChangeSelect() {
                var param = {};
                param.businessLines = businessLines;
                param.isNotSign = -1;
                axios.post('/aggregation/projectManager/listNoPage', param).then(function (response) {
                    mainDivVM.signProjectList = response.data.data;
                });
            }
        },
        created() {
            // window.sessionStorage.clear(); // 点击侧边栏-清除所有cookie
            // 进入页面判断有是否有存储值
            if(!this.paginationShow){
                var storeVal = this.getSessionStore("myCustomerListStoreForm");
                var otherVal = this.getSessionStore("myCustomerListOtherVal");
                if(storeVal && otherVal){
                    this.queryForm = storeVal;
                    this.$set(this.pager,"currentPage",otherVal.currentPage);
                    this.storeId = otherVal.clueId;
                    this.scrollTop = otherVal.scrollTop;
                }
                // 取页数存储
                var localVal=localStorage.getItem('allChangePageSize')?parseInt(localStorage.getItem('allChangePageSize')):'';
                if(localVal){this.pager.pageSize = localVal;}
            };

            var param = {};
            // 电销组以及电销员工名称
            axios.post('/aggregation/businessMyCustomer/teleSaleAndGroupName', param).then(function (response) {
                mainDivVM.teleketGroupArr = response.data.data.teleGroupList;
                mainDivVM.teleketSaleArr = response.data.data.teleSaleList;
            });
            
            // //  到访店铺类型 vistitStoreTypeArr
            // param.groupCode = "vistitStoreType";
            // axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode', param).then(function (response) {
            //     mainDivVM.vistitStoreTypeArr = response.data.data;
            // });

            param = {};
            param.groupCode = "payMode";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode', param).then(function (response) {
                mainDivVM.option3s = response.data.data;
            });

            //初始化省份
            param = {};
            param.type = "0";
            axios.post('/area/sysregion/querySysRegionByParam', param).then(function (response) {
                mainDivVM.provinceArr = response.data.data.data;
            });

            //考察公司
            param = {};
            axios.post('/aggregation/companyManager/listNoPage', param).then(function (response) {
                mainDivVM.companyArr = response.data.data;
            });
            //到访城市
            param = {};
            param.groupCode = "visitCity";
            axios.post('/dictionary/DictionaryItem/dicItemsByGroupCode', param).then(function (response) {
                mainDivVM.visitCityArr = response.data.data;
            });

            // 获取url地址
            // 1未补齐尾款
            // 2未签约
            // 3已签约
          var type=getQueryString("type");
          console.log(type)
            if(type){
                // 隐藏面包屑
                this.isElBreadcrumb=false;
                if(type==1){//未补齐尾款
                    this.queryForm.isTailMoney ="0";
                    this.dataUrlParam.dataUrlArr[1].isActive=true;
                    this.disabledIsTailMoney=true;
                }else if(type==2){//未签约
                    this.queryForm.isSign =0;
                    this.dataUrlParam.dataUrlArr[2].isActive=true;
                    this.disabledIsSign=true;
                }else if(type==3){//已签约
                    this.queryForm.isSign =1;
                    this.dataUrlParam.dataUrlArr[3].isActive=true;
                    this.disabledIsSign=true;
                }
            }
            //初始化数据列表
            this.initList();
            this.projectChangeSelect();

        },
        mounted() {
            document.getElementById('mainDiv').style.display = 'block';
        }
    });

</script>
</body>
</html>